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

chore(ngSwitch): removed the change attr from ngSwitch and updated spec #8858

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/ng/directive/ngSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ var ngSwitchDirective = ['$animate', function($animate) {
selectedScopes.length = 0;

if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {
scope.$eval(attr.change);
forEach(selectedTranscludes, function(selectedTransclude) {
selectedTransclude.transclude(function(caseElement, selectedScope) {
selectedScopes.push(selectedScope);
Expand Down
13 changes: 0 additions & 13 deletions test/ng/directive/ngSwitchSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,6 @@ describe('ngSwitch', function() {
expect(element.text()).toEqual('236');
}));


it('should call change on switch', inject(function($rootScope, $compile) {
element = $compile(
'<ng:switch on="url" change="name=\'works\'">' +
'<div ng-switch-when="a">{{name}}</div>' +
'</ng:switch>')($rootScope);
$rootScope.url = 'a';
$rootScope.$apply();
expect($rootScope.name).toEqual('works');
expect(element.text()).toEqual('works');
}));


it('should properly create and destroy child scopes', inject(function($rootScope, $compile) {
element = $compile(
'<ng:switch on="url">' +
Expand Down