标签:
<!DOCTYPE html>
<html>
<body>
<div ng-app="">
<p>在输入框中尝试输入:</p>
<p>姓名:<input type="text" ng-model="name"></p>
<p ng-bind="name"></p>
</div>
<div ng-app="" ng-init="quantity=1;cost=5">
<p>总价: {{ quantity * cost }}</p>
</div>
<div ng-app="" ng-init="quantity=1;cost=5">
<p>总价: <span ng-bind="quantity * cost"></span></p>
</div>
<div ng-app="" ng-init="firstName=‘John‘;lastName=‘Doe‘">
<p>姓名: {{ firstName + " " + lastName }}</p>
</div>
<div ng-app="" ng-init="firstName=‘John‘;lastName=‘Doe‘">
<p>姓名: <span ng-bind="firstName + ‘ ‘ + lastName"></span></p>
</div>
<div ng-app="" ng-init="person={firstName:‘John‘,lastName:‘Doe‘}">
<p>姓为 {{ person.lastName }}</p>
</div>
<div ng-app="" ng-init="person={firstName:‘John‘,lastName:‘Doe‘}">
<p>姓为 <span ng-bind="person.lastName"></span></p>
</div>
<div ng-app="" ng-init="points=[1,15,19,2,40]">
<p>第三个值为 {{ points[2] }}</p>
</div>
<div ng-app="" ng-init="points=[1,15,19,2,40]">
<p>第三个值为 <span ng-bind="points[2]"></span></p>
</div>
<script src="//www.w3cschool.cc/try/angularjs/1.2.5/angular.min.js"></script>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/18ge/p/4309351.html