gpt4 book ai didi

angularjs - 什么时候不在 AngularJs 中使用 ng-cloak?

转载 作者:行者123 更新时间:2023-12-05 07:33:17 25 4
gpt4 key购买 nike

根据官方文档,关于 AngularJS (ng-cloak) 的一个查询:

The ng-cloak directive is used to prevent the AngularJS 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.

这是否意味着我们应该始终在 AngularJS 应用程序中使用它?或者一直使用它有什么副作用吗?

最佳答案

这是official website中的建议:

The directive can be applied to the element, but the preferred usage is to apply multiple ngCloak directives to small portions of the page to permit progressive rendering of the browser view.

所以对于慢速网络来说,页面会暂时变白,这绝对不是我们想要的结果。

关于angularjs - 什么时候不在 AngularJs 中使用 ng-cloak?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50693372/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com