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
Post a Comment