首页 > 代码库 > angularJS 判断
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>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。