mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-18 15:50:22 +00:00
fix(ng-cloak): work with class
This commit is contained in:
parent
b3750103cc
commit
dd7b0f56fc
2 changed files with 17 additions and 2 deletions
|
|
@ -937,7 +937,7 @@ var ngStyleDirective = ngDirective(function(scope, element, attr) {
|
|||
*/
|
||||
var ngCloakDirective = ngDirective({
|
||||
compile: function(element, attr) {
|
||||
attr.$set(attr.$attr.ngCloak, undefined);
|
||||
attr.$set('ngCloak', undefined);
|
||||
element.removeClass('ng-cloak');
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ describe("directive", function() {
|
|||
}));
|
||||
|
||||
|
||||
it('should remove ng-cloak class from a compiled element', inject(function($rootScope, $compile) {
|
||||
it('should remove ng-cloak class from a compiled element with attribute', inject(function($rootScope, $compile) {
|
||||
element = jqLite('<div ng:cloak class="foo ng-cloak bar"></div>');
|
||||
|
||||
expect(element.hasClass('foo')).toBe(true);
|
||||
|
|
@ -556,6 +556,21 @@ describe("directive", function() {
|
|||
expect(element.hasClass('ng-cloak')).toBe(false);
|
||||
expect(element.hasClass('bar')).toBe(true);
|
||||
}));
|
||||
|
||||
|
||||
it('should remove ng-cloak class from a compiled element', inject(function($rootScope, $compile) {
|
||||
element = jqLite('<div class="foo ng-cloak bar"></div>');
|
||||
|
||||
expect(element.hasClass('foo')).toBe(true);
|
||||
expect(element.hasClass('ng-cloak')).toBe(true);
|
||||
expect(element.hasClass('bar')).toBe(true);
|
||||
|
||||
$compile(element);
|
||||
|
||||
expect(element.hasClass('foo')).toBe(true);
|
||||
expect(element.hasClass('ng-cloak')).toBe(false);
|
||||
expect(element.hasClass('bar')).toBe(true);
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue