Improve this Doc View Source ngBind

From Get docs
< Directive components in ngAngularjs/docs/1.8/api/ng/directive/ngbind

Improve this Doc View Source ngBind

  1. directive in module ng


The ngBind attribute tells AngularJS 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.

Typically, you don't use ngBind directly, but instead you use the double curly markup like Template:Expression which is similar but less verbose.

It is preferable to use ngBind instead of Template:Expression if a template is momentarily displayed by the browser in its raw state before AngularJS compiles it. Since ngBind is an element attribute, it makes the bindings invisible to the user while the page is loading.

An alternative solution to this problem would be using the ngCloak directive.

Directive Info

  • This directive executes at priority level 0.


  • as attribute:

  • as CSS class:

    <ANY class="ng-bind: expression;"> ... </ANY>


Param Type Details
ngBind expression Expression to evaluate.


Enter a name in the Live Preview text box; the greeting below the text box changes instantly.

© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 3.0.