Skip to content

Commit 2691279

Browse files
clkaojamesdaily
authored andcommitted
docs(ngInit): note precedence when used with filters
Clears up expression priority issue Closes angular#3869 Closes angular#5873
1 parent 6370cec commit 2691279

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ng/directive/ngInit.js

Lines changed: 7 additions & 0 deletions
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)