<h1><code ng:non-bindable="">ngBind</code>
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngBind</code> attribute tells Angular to replace the text content of the specified HTML element
with the value of a given expression, and to update the text content when the value of that
expression changes.</p>

<p>Typically, you don't use <code>ngBind</code> directly, but instead you use the double curly markup like
<code>{{ expression }}</code> which is similar but less verbose.</p>

<p>Once scenario in which the use of <code>ngBind</code> is prefered over <code>{{ expression }}</code> binding is when
it's desirable to put bindings into template that is momentarily displayed by the browser in its
raw state before Angular compiles it. Since <code>ngBind</code> is an element attribute, it makes the
bindings invisible to the user while the page is loading.</p>

<p>An alternative solution to this problem would be using the
<a href="api/angular.module.ng.$compileProvider.directive.ngCloak"><code>ngCloak</code></a> directive.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as attribute<pre class="prettyprint linenums">&lt;ANY ng-bind="{expression}"&gt;
   ...
&lt;/ANY&gt;</pre>
as class<pre class="prettyprint linenums">&lt;ANY class="ng-bind: {expression};"&gt;
   ...
&lt;/ANY&gt;</pre>
<h3 id="Parameters">Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">ngBind – {expression} – </code>
<p><a href="guide/dev_guide.expressions">Expression</a> to evaluate.</p></li>
</ul>
</div>
<h2 id="Example">Example</h2>
<div class="example"><p>Enter a name in the Live Preview text box; the greeting below the text box changes instantly.
<h3>Demo Source Code</h3>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-86" source-edit-css="" source-edit-js="script.js-85" source-edit-unit="" source-edit-scenario="scenario.js-87"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-86" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-86">
    
    <div ng-controller="Ctrl">
      Enter name: <input type="text" ng-model="name"><br>
      Hello <span ng-bind="name"></span>!
    </div>
  </script>
</div>
<div class="tab-pane" title="script.js">
<pre class="prettyprint linenums" ng-set-text="script.js-85"></pre>
<script type="text/ng-template" id="script.js-85">
      function Ctrl($scope) {
        $scope.name = 'Whirled';
      }
    </script>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-87"></pre>
<script type="text/ng-template" id="scenario.js-87">
    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');
    });
  </script>
</div>
</div><h3>Demo Source Code</h3>
<div class="well  doc-example-live" ng-embed-app="" ng-set-html="index.html-86" ng-eval-javascript="script.js-85"></div></div>
</div>
