forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.directive.ng:bind-template.html
38 lines (38 loc) · 1.8 KB
/
angular.directive.ng:bind-template.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
34
35
36
37
38
<h1>angular.directive.ng:bind-template</h1>
<div class="angular-directive-ng-bind-template"><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-template</code> attribute specifies that the element
text should be replaced with the template in ng:bind-template.
Unlike ng:bind the ng:bind-template can contain multiple <code>{{</code> <code>}}</code>
expressions. (This is required since some HTML elements
can not have SPAN elements such as TITLE, or OPTION to name a few.</p></div>
<h2>Usage</h2>
<div class="usage"><pre class="brush: js; html-script: true;"><ANY ng:bind-template="template">
...
</ANY></pre>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">template – {string} – </code>
<p>of form
<tt>{{</tt> <tt>expression</tt> <tt>}}</tt> 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>
<doc:source>
Salutation: <input type="text" name="salutation" value="Hello"><br/>
Name: <input type="text" name="name" value="World"><br/>
<pre ng:bind-template="{{salutation}} {{name}}!"></pre>
</doc:source>
<doc:scenario>
it('should check ng:bind', function(){
expect(using('.doc-example-live').binding('{{salutation}} {{name}}')).
toBe('Hello World!');
using('.doc-example-live').input('salutation').enter('Greetings');
using('.doc-example-live').input('name').enter('user');
expect(using('.doc-example-live').binding('{{salutation}} {{name}}')).
toBe('Greetings user!');
});
</doc:scenario>
</doc:example></div>
</div>