1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>AngularJS双向数据绑定</title> 6 <script type="text/javascript" src="../js/angular.min.js"></script> 7 </head> 8 <!--ng-app是angular编程入口,是模块作用域--> 9 <body ng-app> 10 <div> 11 <!--ng-model模型作用--> 12 <input type="text" name="name" ng-model="name"/> 13 </div> 14 <div> 15 <!--{{}}等价于ng-bind用于数据显示--> 16 hello,{{name}} 17 </div> 18 </body> 19 </html>