gpt4 book ai didi

javascript - html 显示 ng-if 计算 angularjs 中的正则表达式之前的结果

转载 作者:行者123 更新时间:2023-12-03 09:10:55 24 4
gpt4 key购买 nike

<div class="alert alert-danger hidden-xs" role="alert" ng-if="OrderDetails.length == 0" style="font-size: large; font-stretch: expanded;
font-weight: bold;">


<p>We're sorry,you currently have no last Order details, but items you've thought will be added automatically when you place an order.</p>


</div>

嗨,正如您从上面看到的,在我的结果从 Controller 加载之前,上面的 html 加载到我的浏览器上,有什么方法可以阻止此 div 在我的结果加载并可在我的网页上显示之前加载?

最佳答案

查看 ng-cloak 的文档

来自文档:

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.

<input id = "search"  ng-if="someCondition" ng-cloak> 

关于javascript - html 显示 ng-if 计算 angularjs 中的正则表达式之前的结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32073136/

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