ng-switch 명령

7387 단어 switch
<!--    -->

<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>

<!--    II-->

<tbody ng-repeat="user in users" ng-click="selectUser(user)" ng-switch on="isSelected(user)">

    <tr>

        <td>{{user.name}}</td>

        <td>{{user.email}}</td>

    </tr>

    <tr ng-switch-when="true">

        <td colspan="2">{{user.desc}}</td>

    </tr>

</tbody>

<!--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>

좋은 웹페이지 즐겨찾기