<!--AngularJS数字-->
<div ng-app="" ng-init="quantity=1;cost=5">
<p>总价:{{quantity*cost}}</p>
</div>
<!--AngularJS字符串-->
<div ng-app="" ng-init="firstName='John';lastName='Doe'">
<p>姓名:{{firstName+""+lastName}}</p>
</div>
<!--AngularJS的对象-->
<div ng-app="" ng-init="person={firstName:'John',lastName:'Doe'}">
<p>姓为{{person.lastName}}</p>
</div>
<!--AugularJS数组-->
<div ng-app="" ng-init="points=[1,5,23,43,23]">
<p>第二个值为:{{points[1]}}</p>
</div>
<!--ng-bind绑定的数字,字符串,对象,数组等-->
<div ng-app="" ng-init="points=[1,5,23,43,32]">
<p>第三个值为:<span ng-bind="points[2]"></span></p>
</div>
AngularJS 表达式
最新推荐文章于 2020-01-02 14:04:43 发布