Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 521ba8c

Browse files
committed
docs(ngSwitch): add separator example
1 parent 79257ee commit 521ba8c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/ng/directive/ngSwitch.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<hr/>
7171
<div class="animate-switch-container"
7272
ng-switch on="selection">
73-
<div class="animate-switch" ng-switch-when="settings">Settings Div</div>
73+
<div class="animate-switch" ng-switch-when="settings|options" ng-switch-when-separator="|">Settings Div</div>
7474
<div class="animate-switch" ng-switch-when="home">Home Span</div>
7575
<div class="animate-switch" ng-switch-default>default</div>
7676
</div>
@@ -79,7 +79,7 @@
7979
<file name="script.js">
8080
angular.module('switchExample', ['ngAnimate'])
8181
.controller('ExampleController', ['$scope', function($scope) {
82-
$scope.items = ['settings', 'home', 'other'];
82+
$scope.items = ['settings', 'home', 'options', 'other'];
8383
$scope.selection = $scope.items[0];
8484
}]);
8585
</file>
@@ -126,8 +126,12 @@
126126
select.all(by.css('option')).get(1).click();
127127
expect(switchElem.getText()).toMatch(/Home Span/);
128128
});
129-
it('should select default', function() {
129+
it('should change to settings via "options"', function() {
130130
select.all(by.css('option')).get(2).click();
131+
expect(switchElem.getText()).toMatch(/Settings Div/);
132+
});
133+
it('should select default', function() {
134+
select.all(by.css('option')).get(3).click();
131135
expect(switchElem.getText()).toMatch(/default/);
132136
});
133137
</file>

0 commit comments

Comments
 (0)