Nice! I had no idea why it was failing. Not sure I'd call auto returning a 
bad habit. In many cases it makes my code shorter and easier to read, 
especially with angular where I'm always returning functions or objects to 
the framework.

I put the onus on Angular for a clearer error message. I thought it was 
detecting the access of a dom node, since that's what the documentation 
said, not the return type of a function.

On Thursday, October 17, 2013 1:36:50 AM UTC-7, Majid Burney wrote:
>
> They've only disallowed accessing DOM nodes in expressions, not in 
> directives. Your code is only broken because of Coffeescript's bad habit of 
> automatically returning the last value in a function's scope. Angular 
> detects that the function has returned a DOM node and throws an exception 
> to keep you safe. Add an explicit "return" to the end of each of those 
> functions and they should work fine.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to