WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

AngularJS ng-bind Directive


Example

Bind the innerHTML of the <p> component to the variable myText:

<div ng-app="" ng-init="myText='Hello World!'">

<p ng-bind="myText"></p>

</div>
Try it yourself »

Definition and Usage

The ng-bind mandate advises AngularJS to supplant the substance of a HTML component with the estimation of a given variable, or expression.

If the estimation of the given variable, or articulation, changes, the substance of the predefined HTML component will be changed as well.


Syntax

<element ng-bind="expression"></element>

Or as a CSS class:

<element class="ng-tie: expression"></element>

Supported by all HTML elements.


Parameter Values

Value Description
expression Specifies a variable, or an articulation to evaluate.