AngularJS 显示和隐藏 ng-show ng-hide ng-switch
前两个是控制 display 的指令:
<div ng-show="true">1</div> <div ng-show="false">2</div> <div ng-hide="true">3</div> <div ng-hide="false">4</div>
后一个 ng-switch 是根据一个值来决定哪个节点显示,其它节点移除:
<div ng-init="a=2"> <ul ng-switch on="a"> <li ng-switch-when="1">1</li> <li ng-switch-when="2">2</li> <li ng-switch-default>other</li> </ul> </div>