Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets, any solution other than one given does not work #14

Open
chrisb1510 opened this issue Nov 2, 2014 · 1 comment
Open

Widgets, any solution other than one given does not work #14

chrisb1510 opened this issue Nov 2, 2014 · 1 comment

Comments

@chrisb1510
Copy link

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

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

@chrisb1510
Copy link
Author

the domify line doesn't show the string correctly '

Hello !
'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant