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

merge! error: m.tag is undefined #15

Closed
soulne4ny opened this issue Feb 11, 2013 · 3 comments
Closed

merge! error: m.tag is undefined #15

soulne4ny opened this issue Feb 11, 2013 · 3 comments

Comments

@soulne4ny
Copy link

Hi!

I'm getting TypeError: m.tag is undefined ... (in FF) on (merge! container (render ...)). In Chrome it is Uncaught TypeError: Cannot call method 'toLowerCase' of undefined.
It seems that https://github.com/lynaghk/singult/blob/master/src/coffee/Singult.coffee#L259 should be like m.tagName.toLowerCase.

Thanks in advance :)

@lynaghk
Copy link
Owner

lynaghk commented Feb 11, 2013

The merge! function takes a hiccup data structure, not another DOM node, which is what you're passing in via the render call.
The render function creates live DOM nodes and is useful for interop with other JavaScript libraries or if you want to do fancy stuff yourself; you don't need to use it if you are just using merge!.

I'll leave this open until you can verify the fix, though.

@lynaghk
Copy link
Owner

lynaghk commented Feb 11, 2013

Also, just FYI, Singult is a bit low-level---a nicer interface for data<->DOM mapping is provided by C2's bind! function.

@soulne4ny
Copy link
Author

Thanks.
It was misuse of merge! merge! and render are working fine when are used properly :)

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

2 participants