docs(ngSwitch): add separator example

This commit is contained in:
Martin Staffa
2016-09-08 21:23:41 +02:00
parent 0b22173000
commit cc8ea72f3a
+7 -3
View File
@@ -70,7 +70,7 @@
<hr/>
<div class="animate-switch-container"
ng-switch on="selection">
<div class="animate-switch" ng-switch-when="settings">Settings Div</div>
<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>
@@ -79,7 +79,7 @@
<file name="script.js">
angular.module('switchExample', ['ngAnimate'])
.controller('ExampleController', ['$scope', function($scope) {
$scope.items = ['settings', 'home', 'other'];
$scope.items = ['settings', 'home', 'options', 'other'];
$scope.selection = $scope.items[0];
}]);
</file>
@@ -126,8 +126,12 @@
select.all(by.css('option')).get(1).click();
expect(switchElem.getText()).toMatch(/Home Span/);
});
it('should select default', function() {
it('should change to settings via "options"', function() {
select.all(by.css('option')).get(2).click();
expect(switchElem.getText()).toMatch(/Settings Div/);
});
it('should select default', function() {
select.all(by.css('option')).get(3).click();
expect(switchElem.getText()).toMatch(/default/);
});
</file>