ng-switch
使用すると動作しませんng-switch-when-separator
。設定を選択すると、スイッチはデフォルトの div を指しています
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>