这似乎主要是 IE 中的一个问题,当需要加载大量图像/脚本时,标记中的文字 {{stringExpression}}
可能会花很长时间显示,然后在 Angular 完成文档的编译/插值后消失。
发生这种情况是否有一个常见的原因,这表明我正在做一些普遍错误的事情,或者是否有已知的方法来防止这种情况?
最佳答案
我认为您正在寻找 ngCloak
指令:https://docs.angularjs.org/api/ng/directive/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.
The directive can be applied to the
<body>
element, but the preferred usage is to apply multiplengCloak
directives to small portions of the page to permit progressive rendering of the browser view
关于angularjs - 防止在 angular.js 编译/插入文档之前暂时显示双花括号符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12866447/