angularJS 判断

判断语句:

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 判断,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。