5
ng-switch
は、使用時に機能しません。ng-switch-when-separator
です。私は設定を選択すると スイッチはこれは角自体のバグドキュメントページの問題ですが、ないのdivanggSでng-switch-when-separatorが機能しない
angular.module("myModule", [])
.controller("myController", function ($scope) {
$scope.items = ['settings', 'home', 'options', 'other'];
$scope.opt = $scope.items[0];
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app="myModule">
<div ng-controller="myController">
<select ng-model="opt" ng-options="item for item in items">
</select>
<code>selection={{opt}}</code>
<hr />
<div class="animate-switch-container"
ng-switch on="opt">
<div class="animate-switch" ng-switch-when="settings|options" ng-switch-when-separator="|">Settings Div</div>
<div class="animate-switch" ng-switch-when="home">Home Span</div>
<div class="animate-switch" ng-switch-default>default</div>
</div>
</div>
</body>
このhttp://learnkode.com/Tryit/Example/Ng-Switch-1 –
[彼らのデモ](https://plnkr.co/edit/jzYWNZiWzyLWkCnStVtW?p=previewが)同じことを試してみてください。.. 。バグのように見えます。 "Edit in Plunker"ボタンをクリックします。それはドキュメントページで動作するので変です。 – Zach
バグ報告を作成しましたhttps://github.com/angular/angular.js/issues/15266 – Sajan