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

angularJS 判断

时间:2014-07-22 22:36:13      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   re   c   div   

判断语句:

ng-switch on

ng-switch-when
ng-switch-when
ng-if=”person.sex==1“

<ul>
<li ng-repeat=”person in persons”>

<span ng-switch on=”person.sex”>
<span ng-switch-when=”1〃>you are a boy</span>
<span ng-switch-when=”2〃>you are a girl</span>
</span>

<div ng-switch on="person.Clickable">
    <div ng-switch-when="1" class="item_wrap">
        <a href="#/MettingDetail">
             {{person.Name}}
          </a>
     </div>
     <div ng-switch-when="0" class="item_wrap">
            <a>{{person.Name}}</a>
     </div>
</div>

<span ng-if=”person.sex==1〃>you may be a father</span>
<span ng-show=”person.sex==2〃>you may be a mother</span>

<span>
please input your baby’s name:<input type=”text” ng-disabled=”!person.hasBaby”/>
</span>

</li>
</ul>

angularJS 判断,布布扣,bubuko.com

angularJS 判断

标签:style   blog   color   re   c   div   

原文地址:http://www.cnblogs.com/yujian-bcq/p/3860851.html

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