angularjs - How can I defer view rendering until some data is loaded from an external source? -


my app needs load data $rootscope external source when initializes. since data external source, time required load data not guaranteed. want defer rendering of view until after data loaded successfully. there way achieve this?

note not using angular routing app.

here simplified demo

there isn't clean way prevent view rendering until async operation completes without using route resolves, program custom directive same work.

however, if strictly user experience, using ngshow work swimmingly:

<div ng-show="user.name">   <!-- content won't visible until data set --> </div> 

here's updated plunker: http://plnkr.co/edit/mxoqnwhvyp9aoxg0qooc?p=preview


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -