Two-Way Binding in AngularJS

Two way binding in AngularJs is when model and view are bind together means if view is updated the model is automatic updated and if model is updated then view is automatically updated.
 
Example
  1. <!DOCTYPE html>  
  2. <html>  
  3. <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>  
  4. <body>  
  5.   
  6. <div ng-app="myApp" ng-controller="myCtrl">  
  7. Name: <input ng-model="name">  
  8. <h1>You entered: {{name}}</h1>  
  9. </div>  
  10.   
  11. <script>  
  12. var app = angular.module('myApp', []);  
  13. app.controller('myCtrl', function($scope) {  
  14.     $scope.name = "Ajay Malik";  
  15. });  
  16. </script>  
  17.   
  18. <p>This is two way binding</p>  
  19.   
  20. </body>  
  21. </html>