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>

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


Click here to write/view comments