File tree 1 file changed +13
-9
lines changed
1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 5
5
* @name ngInit
6
6
* @restrict AC
7
7
* @priority 450
8
+ * @element ANY
9
+ *
10
+ * @param {expression } ngInit {@link guide/expression Expression } to eval.
8
11
*
9
12
* @description
10
13
* The `ngInit` directive allows you to evaluate an expression in the
11
14
* current scope.
12
15
*
13
16
* <div class="alert alert-danger">
14
17
* This directive can be abused to add unnecessary amounts of logic into your templates.
15
- * There are only a few appropriate uses of `ngInit`, such as for aliasing special properties of
16
- * {@link ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below; and for injecting data via
17
- * server side scripting. Besides these few cases, you should use {@link guide/controller controllers}
18
- * rather than `ngInit` to initialize values on a scope.
18
+ * There are only a few appropriate uses of `ngInit`:
19
+ * <ul>
20
+ * <li>aliasing special properties of {@link ng.directive:ngRepeat `ngRepeat`},
21
+ * as seen in the demo below.</li>
22
+ * <li>initializing data during development, or for examples, as seen throughout these docs.</li>
23
+ * <li>injecting data via server side scripting.</li>
24
+ * </ul>
25
+ *
26
+ * Besides these few cases, you should use {@link guide/component Components} or
27
+ * {@link guide/controller Controllers} rather than `ngInit` to initialize values on a scope.
19
28
* </div>
20
29
*
21
30
* <div class="alert alert-warning">
26
35
* </pre>
27
36
* </div>
28
37
*
29
- * @priority 450
30
- *
31
- * @element ANY
32
- * @param {expression } ngInit {@link guide/expression Expression } to eval.
33
- *
34
38
* @example
35
39
<example module="initExample" name="ng-init">
36
40
<file name="index.html">
You can’t perform that action at this time.
0 commit comments