<a href='https://github.com/angular/angular.js/edit/v1.6.x/src/ng/directive/ngBind.js?message=docs(ngBindTemplate)%3A%20describe%20your%20change...#L71' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.6.6/src/ng/directive/ngBind.js#L71' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">ngBindTemplate</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
    <li>
      - directive in module <a href="api/ng">ng</a>
    </li>
  </ol>
</header>





<div class="api-profile-description">
  <p>The <code>ngBindTemplate</code> directive specifies that the element
text content should be replaced with the interpolation of the template
in the <code>ngBindTemplate</code> attribute.
Unlike <code>ngBind</code>, the <code>ngBindTemplate</code> can contain multiple <code>{{</code> <code>}}</code>
expressions. This directive is needed since some HTML elements
(such as TITLE and OPTION) cannot contain SPAN elements.</p>

</div>




<div>
  

  
  <h2>Directive Info</h2>
  <ul>
    
    <li>This directive executes at priority level 0.</li>
    
  </ul>

  
  <h2 id="usage">Usage</h2>
  <div class="usage">
  
    <ul>
    
      <li>as element:
      <pre><code>&lt;ng-bind-template&#10;  ng-bind-template=&quot;string&quot;&gt;&#10;...&#10;&lt;/ng-bind-template&gt;</code></pre>
      </li>
    <li>as attribute:
        <pre><code>&lt;ANY&#10;  ng-bind-template=&quot;string&quot;&gt;&#10;...&#10;&lt;/ANY&gt;</code></pre>
      </li>
    
  </div>
  
<section class="api-section">
  <h3>Arguments</h3>

<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        ngBindTemplate
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>template of form
  <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

</section>
  

  
  <h2 id="example">Examples</h2><p>Try it here: enter text in text box and watch the greeting change.
   

<div>
  <plnkr-opener example-path="examples/example-ng-bind-template"></plnkr-opener>

  <div class="runnable-example"
      path="examples/example-ng-bind-template"
      module="bindExample"
      name="ng-bind-template">

  
    <div class="runnable-example-file" 
      name="index.html"
      language="html"
      type="html">
      <pre><code>&lt;script&gt;&#10;  angular.module(&#39;bindExample&#39;, [])&#10;    .controller(&#39;ExampleController&#39;, [&#39;$scope&#39;, function($scope) {&#10;      $scope.salutation = &#39;Hello&#39;;&#10;      $scope.name = &#39;World&#39;;&#10;    }]);&#10;&lt;/script&gt;&#10;&lt;div ng-controller=&quot;ExampleController&quot;&gt;&#10; &lt;label&gt;Salutation: &lt;input type=&quot;text&quot; ng-model=&quot;salutation&quot;&gt;&lt;/label&gt;&lt;br&gt;&#10; &lt;label&gt;Name: &lt;input type=&quot;text&quot; ng-model=&quot;name&quot;&gt;&lt;/label&gt;&lt;br&gt;&#10; &lt;pre ng-bind-template=&quot;{{salutation}} {{name}}!&quot;&gt;&lt;/pre&gt;&#10;&lt;/div&gt;</code></pre>
    </div>
  
    <div class="runnable-example-file" 
      name="protractor.js"
      type="protractor"
      language="js">
      <pre><code>it(&#39;should check ng-bind&#39;, function() {&#10;  var salutationElem = element(by.binding(&#39;salutation&#39;));&#10;  var salutationInput = element(by.model(&#39;salutation&#39;));&#10;  var nameInput = element(by.model(&#39;name&#39;));&#10;&#10;  expect(salutationElem.getText()).toBe(&#39;Hello World!&#39;);&#10;&#10;  salutationInput.clear();&#10;  salutationInput.sendKeys(&#39;Greetings&#39;);&#10;  nameInput.clear();&#10;  nameInput.sendKeys(&#39;user&#39;);&#10;&#10;  expect(salutationElem.getText()).toBe(&#39;Greetings user!&#39;);&#10;});</code></pre>
    </div>
  

    <iframe class="runnable-example-frame" ng-src="{{getExampleIndex('examples/example-ng-bind-template')}}" name="example-ng-bind-template"></iframe>
  </div>
</div>


</p>

</div>


