AngularJS ng-bind-template example

AngularJS ng-bind-template attribute take a template string and can contain multiple {{ }} expressions.

<div ng-app="myApp" ng-controller='MyCtrl'>
  Salutation: <input type="text" ng-model="salutation" ng-init="salutation='Hello'"><br>
  Name: <input type="text" ng-model="name" ng-init="name='John'"><br>
  <div ng-bind-template="{{salutation}} {{name}}!"></div>
</div>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
<script>
  var module = angular.module('myApp', []);
  module.controller('MyCtrl', function($scope) {});
</script>
refresh
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments