RJV*_*RJV 5 html angularjs angularjs-directive angularjs-ng-switch
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];
});Run Code Online (Sandbox Code Playgroud)
<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>Run Code Online (Sandbox Code Playgroud)
这是文档页面的问题,但不是 Angular本身的错误.怎么了:
所以你必须等待1.5.10才能使用该功能.