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

Commit da75d13

Browse files
Narretzlgalfaso
authored andcommitted
test(ngStyle): ensure lazy one-time binding is supported
Closes #11405
1 parent 171b9f7 commit da75d13

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/ng/directive/ngStyleSpec.js

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ describe('ngStyle', function() {
2323
}));
2424

2525

26+
it('should support lazy one-time binding for object literals', inject(function($rootScope, $compile) {
27+
element = $compile('<div ng-style="::{height: heightStr}"></div>')($rootScope);
28+
$rootScope.$digest();
29+
expect(element.css('height')).toBeFalsy();
30+
$rootScope.$apply('heightStr = "40px"');
31+
expect(element.css('height')).toBe('40px');
32+
}));
33+
34+
2635
describe('preserving styles set before and after compilation', function() {
2736
var scope, preCompStyle, preCompVal, postCompStyle, postCompVal, element;
2837

0 commit comments

Comments
 (0)