简体   繁体   English

AngularJs的原始模板在被替换之前会在IOS上短暂显示

[英]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

Try using ng-bind 尝试使用ng-bind

<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.

相关问题 用自定义按钮替换后,iOS导航栏中的原始后退按钮会短暂显示 - Original back button in iOS navigation bar shows briefly after replacing it with a custom one li: 在 IOS 浏览器上忽略 css 之前 - li:before css being ignored on IOS browsers PhoneGap +横向:SplashScreen正确加载,然后短暂旋转,然后闪烁并消失 - PhoneGap + Landscape: SplashScreen Loads Properly, Then Rotates Briefly Before Flashing and Disappearing spring mvc decoding +正在被空间取代 - spring mvc decoding + is being replaced with space 是否有一个模板XCode项目,我可以用它来制作一个只显示网页的iOS应用程序? - Is there a template XCode project I can use for making an iOS app that just shows a webpage? SQLite3中的REPLACE INTO语句显示了已替换的行,但实际上不是 - the REPLACE INTO statement in SQLite3 shows a replaced row but actually it isn't 是否可以在 iOS 应用程序提交到 appstore 之前找到它的 iTunes 链接? - Is it possible to find out itunes link for iOS application before it being submitted to appstore? iOS支持佳能RAW格式吗? - iOS support for Canon RAW format? 更新iOS应用并替换SQLite3表 - Updating an iOS app and having the SQLite3 tables not be replaced 应用程序在iOS中显示黑屏 - App shows black screen in iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM