首页 > 代码库 > [AngularJS] ngCloak

[AngularJS] ngCloak

The ngCloak directive is used to prevent the Angular html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. Use this directive to avoid the undesirable flicker effect caused by the html template display.

Add those code to css:

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

 

Usage:

<div id="template1" ng-cloak>{{ ‘hello‘ }}</div><div id="template2" ng-cloak class="ng-cloak">{{ ‘hello IE7‘ }}</div>

 

See: https://docs.angularjs.org/api/ng/directive/ngCloak

[AngularJS] ngCloak