1 <body ng-app=""> 2 3 <div ng-controller="firstController"> 4 <input type="text" ng-model="name" value=""/> 5 <input type="text" ng-model="age" value=""/> 6 <div ng-bind="name"></div> 7 <div ng-bind="age"></div> 8 <script> 9 var firstController = function($scope){ 10 //scope叫做作用于 11 $scope.name = "张三"; 12 $scope.age = "20"; 13 } 14 </script> 15 </div> 16 </body>