167
AngularJS ng-bind-template Directive
The AngularJS ng-bind-template directive specifies that the text content should be replaced with a template. It replaces the content of an HTML element with the value of the given expressions.
Unlike ngBind, the ngBindTemplate can contain multiple {{ }} expressions. So, it is used when we want to bind more than one expression to your HTML element. It is required because some HTML elements like TITLE and OPTION cannot contain SPAN elements.
Syntax:
Parameter explanation:
expression: It specifies one or more expressions to evaluate, each surrounded by {{ }}.
Let’s take an example to demonstrate ng-bind-template directive.
See this example:
Next TopicAngularJS ng-change Directive