码迷,mamicode.com
首页 > Web开发 > 详细

[AngularJS] ngCloak

时间:2014-12-27 06:42:42      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

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

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/4187946.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!