Ng-Bind-Template-8

 

In this example of ng-bind-template, We are printing the count of Football and Baseball like Number of Footballs:

Number of Baseballs:

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> </head> <body ng-app="app"> <div ng-controller="controllerName"> <div class="container"> <label>Football<input class="form-control" min="0" type="number" ng-model="Football" /></label><br /> <label>Baseball<input class="form-control" min="0" type="number" ng-model="Baseball" /></label><br /> Number of Footballs: <span ng-bind-template="{{Football}}"></span><br /> Number of Baseballs: <span ng-bind-template="{{Baseball}}"></span> </div> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { $scope.Football = 1; $scope.Baseball = 2; }]); </script> </body> </html>
Output