File tree 1 file changed +31
-0
lines changed
docs/content/error/$parse
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,34 @@ perform this check - it's up to the developer to not expose such sensitive and p
14
14
directly on the scope chain.
15
15
16
16
To resolve this error, avoid access to DOM nodes.
17
+
18
+
19
+ # Event Handlers and Return Values
20
+
21
+ The `$parse:isecdom` error also occurs when an event handler invokes a function that returns a DOM
22
+ node.
23
+
24
+ ```html
25
+ <button ng-click="iWillReturnDOM()">click me</button>
26
+ ```
27
+
28
+ ```js
29
+ $scope.iWillReturnDOM = function() {
30
+ return someDomNode;
31
+ }
32
+ ```
33
+
34
+ To fix this issue, avoid returning DOM nodes from event handlers.
35
+
36
+ *Note: This error often means that you are accessing DOM from your controllers, which is usually
37
+ a sign of poor coding style that violates separation of concerns.*
38
+
39
+
40
+ # Implicit Returns in CoffeeScript
41
+
42
+ This error can occur more frequently when using CoffeeScript, which has a feature called implicit
43
+ returns. This language feature returns the last dereferenced object in the function when the
44
+ function has no explicit return statement.
45
+
46
+ The solution in this scenario is to add an explicit return statement. For example `return false` to
47
+ the function.
You can’t perform that action at this time.
0 commit comments