forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.directive.ng:bind.html
33 lines (33 loc) · 1.58 KB
/
angular.directive.ng:bind.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
31
32
33
<h1>angular.directive.ng:bind</h1>
<div class="angular-directive-ng-bind"><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>The <code>ng:bind</code> attribute asks <tt><angular/></tt> to replace the text content of this
HTML element with the value of the given expression and kept it up to
date when the expression's value changes. Usually you just write
{{expression}} and let <tt><angular/></tt> compile it into
<code><span ng:bind="expression"></span></code> at bootstrap time.</p></div>
<h2>Usage</h2>
<div class="usage"><pre class="brush: js; html-script: true;"><ANY ng:bind="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"><p>Try it here: enter text in text box and watch the greeting change.</p><doc:example>
<pre class="doc-source">
Enter name: <input type="text" name="name" value="Whirled">. <br>
Hello <span ng:bind="name" />!
</pre>
<pre class="doc-scenario">
it('should check ng:bind', function(){
expect(using('.doc-example-live').binding('name')).toBe('Whirled');
using('.doc-example-live').input('name').enter('world');
expect(using('.doc-example-live').binding('name')).toBe('world');
});
</pre>
</doc:example></div>
</div>