javascript - AngularJS strategy to prevent flash-of-unstyled-content for a class -


i have angularjs project, want prevent fouc during page load on classname. i've read ng-template seems useful content within tag.

<body class="{{ bodyclass }}"> 

i "login" on page load. strategy this? or have fudge , load 'login' , manually use javascript to tweak dom instance.

what looking ng-cloak.
have add this:

<body class="{{ bodyclass }}" ng-cloak> 

and prevent unwanted flashing.
link docs this.

edit:
advisable put snippet below css file, according docs.

"for best result, angular.js script must loaded in head section of html document; alternatively, css rule above must included in external stylesheet of application."

[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {     display: none !important; } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -