Skip to content

Instantly share code, notes, and snippets.

@hsuh
Created May 20, 2014 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsuh/d47bc8ddaaed1dbc2f38 to your computer and use it in GitHub Desktop.
Save hsuh/d47bc8ddaaed1dbc2f38 to your computer and use it in GitHub Desktop.
angular error: Error: $parse:isecdom Referencing a DOM node in Expression
To solve this write an explicit return for your coffeescript function.
"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."
discussion: https://groups.google.com/forum/#!topic/angular/bsTbZ86WAY4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment