隐藏尖括号直到加载的javascript [英] Hide Angular brackets until javascript loaded
问题描述
我的HTML几位像
< p =类noresults> {{numberOfContacts}}结果可用< / P>
是否有可能对我来说,隐藏 {{} numberOfContacts}
直到角加载?所以,只想说结果可
我有一些似乎解决方案,比如隐藏了整个身体,直到角加载,但我宁愿没有这样做,如果可能的。
是,使用 NG-斗篷。只需添加类=NG-斗篷
或 NG-斗篷
来像这样的元素
使用指令< DIV NG-斗篷>< / DIV>
使用类< DIV CLASS =NG-斗篷>< / DIV>
这是简单地用一组CSS规则显示:无重要
和角已经呈现在DOM它消除了NG-斗篷等等元素是可见。 p>
I have a few bits of HTML like
<p class="noresults">{{numberOfContacts}} Results Are Available</p>
Is it possible for me to hide {{numberOfContacts}}
until Angular has loaded? So it would just say Results Are Available
I've seem some solutions such as hiding the entire body until Angular has loaded, but I'd rather not do that if possible.
Yes, use ng-cloak. Simply add class="ng-cloak"
or ng-cloak
to an element like this
Using directive <div ng-cloak></div>
Using class <div class="ng-cloak"></div>
It's simply a set of CSS rules with display: none !important
and as Angular has rendered your DOM it removes the ng-cloak so an element is visible.
这篇关于隐藏尖括号直到加载的javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!