angular.directive.ng:bind-template

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

The ng:bind-template 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 {{ }} expressions. (This is required since some HTML elements can not have SPAN elements such as TITLE, or OPTION to name a few.)

Usage

<ANY ng:bind-template="template">
   ...
</ANY>

Parameters

Example

Try it here: enter text in text box and watch the greeting change.

   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>
  
    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!');
    });