标签:
<!--标准用法--> <div ng-switch on="showSecret"> <div ng-switch-when="true">Secrect</div> <div ng-switch-default>Won‘t show you my Secrects!</div> </div> <!--灵巧用法--> <li ng-repeat="crumb in crumbs.getAll()"> <span class="divider">/</span> <ng-switch on="$last"> <span ng-switch-when="true">{{crumb.name}}</span> <span ng-switch-default> <a href="{{crumb.path}}">{{crumb.name}}</a> </span> </ng-switch> </li> <!--ng-switch-when和-default必须作为属性,不能作为元素标签用--> <!--例如下面这种写法是不行的!(已验证)--> <ng-switch on="$last"> <ng-switch-when="true">{{crumb.name}}</ng-switch-when> <ng-switch-default> <a href="{{crumb.path}}">{{crumb.name}}</a> </ng-switch-default> </ng-switch>
标签:
原文地址:http://www.cnblogs.com/Denny_Yang/p/4533297.html