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

Commit e1e16ba

Browse files
committed
chore(ngSwitch): removed the change attr from ngSwitch and updated spec
1 parent cd21602 commit e1e16ba

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

src/ng/directive/ngSwitch.js

-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ var ngSwitchDirective = ['$animate', function($animate) {
164164
selectedScopes.length = 0;
165165

166166
if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {
167-
scope.$eval(attr.change);
168167
forEach(selectedTranscludes, function(selectedTransclude) {
169168
selectedTransclude.transclude(function(caseElement, selectedScope) {
170169
selectedScopes.push(selectedScope);

test/ng/directive/ngSwitchSpec.js

-13
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,6 @@ describe('ngSwitch', function() {
208208
expect(element.text()).toEqual('236');
209209
}));
210210

211-
212-
it('should call change on switch', inject(function($rootScope, $compile) {
213-
element = $compile(
214-
'<ng:switch on="url" change="name=\'works\'">' +
215-
'<div ng-switch-when="a">{{name}}</div>' +
216-
'</ng:switch>')($rootScope);
217-
$rootScope.url = 'a';
218-
$rootScope.$apply();
219-
expect($rootScope.name).toEqual('works');
220-
expect(element.text()).toEqual('works');
221-
}));
222-
223-
224211
it('should properly create and destroy child scopes', inject(function($rootScope, $compile) {
225212
element = $compile(
226213
'<ng:switch on="url">' +

0 commit comments

Comments
 (0)