码迷,mamicode.com
首页 > Web开发 > 详细

html angularjs 杂记

时间:2016-01-09 18:36:11      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

<!-- ng-repeat 遍历数组 -->
<ul>
    <li ng-repeat="item in myAarray">{{item}}</li>
</ul>
<ul>
    <li ng-repeat-start="user in users">{{user.name}}</li>
    <li ng-repeat-end>{{user.email}}</li>
</ul>
<!-- ng-repeat map遍历 -->
<ul>
    <li ng-repeat="(key,value) in myMap">{{key}} | {{value}}</li>
</ul>
<!-- 当isActive为真的时候class为active 相反则为inActive -->
<div ng-class="{true: ‘active‘, false: ‘inActive‘}[isActive]"></div>
<!-- 当 isSelected = true 则增加selected class 当isCar = true 则增加car class-->
<div ng-class="{‘selected‘: isSelected, ‘car‘: isCar}"></div>

 

html angularjs 杂记

标签:

原文地址:http://www.cnblogs.com/pumushan/p/5116806.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!