forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.directive.ng:init.html
30 lines (30 loc) · 1.13 KB
/
angular.directive.ng:init.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<h1>angular.directive.ng:init</h1>
<div class="angular-directive-ng-init"><fieldset class="workInProgress"><legend>Work in Progress</legend>
This page is currently being revised. It might be incomplete or contain inaccuracies.</fieldset>
<h2>Description</h2>
<div class="description"><p><code>ng:init</code> attribute allows the for initialization tasks to be executed
before the template enters execution mode during bootstrap.</p></div>
<h2>Usage</h2>
<div class="usage"><pre class="brush: js; html-script: true;"><ANY ng:init="expression">
...
</ANY></pre>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">expression – {expression} – </code>
<p><a href="#!guide.expression">Expression</a> to eval.</p></li>
</ul>
</div>
<h2>Example</h2>
<div class="example"><doc:example>
<pre class="doc-source">
<div ng:init="greeting='Hello'; person='World'">
{{greeting}} {{person}}!
</div>
</pre>
<pre class="doc-scenario">
it('should check greeting', function(){
expect(binding('greeting')).toBe('Hello');
expect(binding('person')).toBe('World');
});
</pre>
</doc:example></div>
</div>