You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I've tried this solution for a while now and get no success unless I use the given solution, the method setName is always undefined, while code.js is MIME-Type text/plain.
Here is one of many solutions I tried
//Coffeescript
domify = require 'domify'
Widget = () ->
if (!(@ instanceof Widget))
return new Widget() @element = domify('
Hello !
')
Widget::setName = (name) ->
@element.querySelector('.name').textContent = name
Hi I've tried this solution for a while now and get no success unless I use the given solution, the method setName is always undefined, while code.js is MIME-Type text/plain.
Here is one of many solutions I tried
//Coffeescript
domify = require 'domify'
Widget = () ->
if (!(@ instanceof Widget))
return new Widget()
@element = domify('
Widget::setName = (name) ->
@element.querySelector('.name').textContent = name
Widget::appendTo = (target) ->
target.appendChild(@element)
module.exports = Widget
I've tried compiling with and without a function wrapper and run it from the .js file
Thanks
The text was updated successfully, but these errors were encountered: