1 ng-app 作用域 2 ng-init 声明 3 module 模块 4 ng-model 双向绑定 5 ng-bind 绑定 6 angular是一个MVC框架:即 7 M------------------module 模块 8 V-------------------view视野 9 C------------------controller控制器 10 一、angular开头的声明 11 ng-app angular作用域一般写在body标签内或者html标签内 12 ng-init="b=2;a=3;" 声明 (声明d=2;) 13 14 列如: 15 <div>2018-03-082018-03-08 16 {{a}} angular声明的参数一定要放在{{}} 括号内才能解析 17 </div> 18 <div> 19 {{b}} 20 </div> 21 <div> 22 {{a+b}} 23 </div> 24 <h1>{{a}}+{{b}}</h1> 25 <div> 26 {{a*b}} 27 </div> 28 二、绑定(ng-bind) 29 <h1 ng-bind="b*a"></h1> h1标签内是6 30 三、ng-model模型 31 <body ng-app ng-init="a=3;b=5;"> 32 <h1>{{a}}</h1>‘ 33 <h1>{{a*b}}</h1> 34 <h1>{{a+b}}</h1> 35 <input ng-model="a" /> 36 <input ng-model="b" /> 37 <!--双向绑定------脏检查--> 38 </body> 39 等输出到页面的时候修改input的数整个页面从新进行运算