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

Commit bd97464

Browse files
committed
test(ngClass): add the case mixed array/object variable with a mutating object
1 parent 5d695e5 commit bd97464

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/ng/directive/ngClassSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,18 @@ describe('ngClass', function() {
409409
expect(e2.hasClass('even')).toBeTruthy();
410410
expect(e2.hasClass('odd')).toBeFalsy();
411411
}));
412+
413+
it('should support changing multiple classes via variable array mixed with conditionally via a map', inject(function($rootScope, $compile) {
414+
$rootScope.classVar = ['', {orange: true}];
415+
element = $compile('<div class="existing" ng-class="classVar"></div>')($rootScope);
416+
$rootScope.$digest();
417+
418+
$rootScope.classVar[1].orange = false;
419+
$rootScope.$digest();
420+
421+
expect(element.hasClass('orange')).toBeFalsy();
422+
}));
423+
412424
});
413425

414426
describe('ngClass animations', function() {

0 commit comments

Comments
 (0)