Angularjs Examples

AJS Examples


AngularJS ng-bind-Template Directive

The ng-bind-template directive is used to binds multiple expressions to the view. Unlike ng-Bind, the ngBindTemplate can contain multiple {{ }} expressions.

Syntax

<p ng-bind-template="{{name}} {{address}} {{ email }}"></p> 

AngularJS ng-bind-Template Directive Example

<html>
<head>
<title>My first AngularJS ng-bind-template code</title>
<script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">
</script>
<script>
//Defining Controller Using Standard Javascrip Object Constructor
function CustomerController($scope) {
  $scope.customer = { name: "Jimi Scott", address: "12-13-283/A1", email: "Jimi@yahoo.com" };
}
</script>
</head>
<body>
<div ng-app="">
<div ng-controller="CustomerController"> 
<span ng-bind-template="{{ customer.name}} {{ customer.address }} {{ customer.email }}"></span>

</div>
</div>
</body>
</html>
See Live Example