[英]AngularJs raw template shows briefly on IOS before being replaced
I've a mobile site based on angularJs, on a normal machine it looks fine. 我有一个基于angularJs的移动网站,在普通计算机上看起来还不错。 When I take it to IOS.
当我带它到IOS时。 I notice that the raw template is shown briefly before the text is replaced by angularJs.
我注意到在用angularJs替换文本之前,原始模板已短暂显示。
ie i have {{TitleText}} show up briefly, before I see it being replaced. 也就是说,在我看到{{TitleText}}被替换之前,我短暂地显示了它。 It seems to be more apparent on iphone than ipad, I guess from the performance of the machine.
从机器的性能来看,在iphone上似乎比ipad更明显。 It's also more apparent on logic heavy pages..
在逻辑沉重的页面上也更明显。
My question is that is there a way to prevent the raw template from displaying on slower browsers? 我的问题是,有没有办法防止原始模板在较慢的浏览器上显示? maybe a built in loading screen to hide the details until the page loads?
也许内置的加载屏幕可以隐藏详细信息,直到页面加载完毕?
使用ng-bind的另一种选择是ng-cloak
<h1 ng-bind="TitleText"></h1>
In slower browsers the element will appear empty until angular has finished loading 在较慢的浏览器中,该元素将显示为空,直到角度加载完成
Edit: Instead of an empty element, placeholder text can be used. 编辑:可以使用占位符文本代替空元素。
<h1 ng-bind="TitleText">Loading Title...</h1>
"Loading Title..." will be replaced with the value of TitleText
after angular has finished loading. angular完成加载后,“ Loading Title ...”将替换为
TitleText
的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.