I have an issue in angular.js with directive/class ng-cloak or ng-show.
Chrome works fine, but Firefox is causing blink of elements with ng-cloak or ng-show.
IMHO it’s caused by the converting ng-cloak/ng-show to style="display: none;", probably the Firefox javascript compiler is little bit slower, so the elements appears for a while and then hide?
Example:
<ul ng-show="foo != null" ng-cloak>..</ul>
Though the documentation doesn’t mention it, it might not be enough to add the
display: none;rule to your CSS. In cases where you are loading angular.js in the body or templates aren’t compiled soon enough, use theng-cloakdirective and include the following in your CSS:As mentioned in the comment, the
!importantis important. For example, if you have the following markupand you happen to be using
bootstrap.css, the following selector is more specific for yourng-cloak‘ed elementSo if you include a rule with simply
display: none;, Bootstrap’s rule will take precedence and thedisplaywill be set toblock, so you’ll see the flicker before the template compiles.