AngularJS ng-bind example

AngularJS ng-bind attribute tells Angular to replace the text content of the specified HTML element with the value of a given expression. It also updates the text content when the value of that expression changes.

<div ng-app="myApp" ng-controller='MyCtrl'>
  Enter Name: <input type="text" ng-model="name" ng-init="name='John'"><br>
  Hello <span ng-bind="name"></span>!

<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