You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ng-cloak is showing template bindings during ng-init with an alert on Chrome, Firefox, and IE. ng-cloaked areas should never show template bindings braces and variables, and Angular should let the ng-init and template variable interpolation merge complete before showing the elements that are ng-cloaked.
If things go wrong during ng-init, it can be necessary to display a message to the user. It looks bad to still see the template braces and variable bindings behind the message. End users should never see the Angular templates unbound with braces and variable names.
Currently the angular code that removes the hidden styling of the ng-cloaked elements is executed before ng-init executes which is too soon.
CURRENT BEHAVIOR:
/* angular.js 1.1.5 code removes cloaked attribute during the compile phase and compile happens before ng-init which is too soon. Browser immediately renders without the css display:none that the ng-cloak class was providing. */
var ngCloakDirective = ngDirective({
compile: function(element, attr) {
attr.$set('ngCloak', undefined);
element.removeClass('ng-cloak');
}
});
REQUESTED BEHAVIOR:
/* One option for fixing this in the angular.js file is to delay until after the compile phase and ng-init are completed such as the following modification which changes when the ng-cloak class is removed to the link phase which happens after ng-init so the template bindings braces and variables are correctly not visible during ng-init... */
var ngCloakDirective = ngDirective({
link: function (scope, element, attr) {
attr.$set('ngCloak', undefined);
element.removeClass('ng-cloak');
}
});