AngularJS ng-bind-template Instruction
AngularJS Examples
Bind two expressions on the element:
<
div
ng-app=
"myApp"
ng-bind-template="{{firstName}} {{lastName}}"
ng-controller=
"myCtrl"
<
/div
<
scriptvar app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
});
<
/script
Try it »
Definition and Usage
ng-bind-template The directive tells AngularJS to replace the content of the HTML element with the value of the given expression.
When you want to bind multiple expressions on an HTML element, you can use ng-bind-template directives.
Syntax
<
element
ng-bind-template=
"expression"
<
/elementAll HTML elements support this directive.
Parameter value
| Value | Description |
|---|---|
| expression | One or more expressions to execute, each enclosed in {{ }}. |
AngularJS Reference Manual