Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 42ec95e

Browse files
clkaocaitp
authored andcommitted
docs(ngInit): note precedence when used with filters
Clears up expression priority issue Closes #3869 Closes #5873
1 parent 1028cfa commit 42ec95e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ng/directive/ngInit.js

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
* should use {@link guide/controller controllers} rather than `ngInit`
1616
* to initialize values on a scope.
1717
* </div>
18+
* <div class="alert alert-warning">
19+
* **Note**: If you have assignment in `ngInit` along with {@link api/ng.$filter `$filter`}, make
20+
* sure you have parenthesis for correct precedence:
21+
* <pre class="prettyprint">
22+
* <ng-init="test1 = (data | orderBy:'name')">
23+
* </pre>
24+
* </div>
1825
*
1926
* @priority 450
2027
*

0 commit comments

Comments
 (0)