<!DOCTYPE html> <div ng-app="myApp" ng-controller="myCtrl"> <input ng-model="name"> <h1>My name is {{name}}</h1> </div> <script> <p>When you change the name in the input field, the changes will affect the model, and it will also affect the name property in the controller.</p> </body> |
My name is {{name}}When you change the name in the input field, the changes will affect the model, and it will also affect the name property in the controller. |