Don’t you hate it when the page flickers when it’s loading?!? Of course you can implement a loading screen or image but there is an easier way with AngularJS. You can use ng-cloak class to stop that flickering of your Templates when your page is loading.
Typically you might apply the class to an element such as alert.
1 2 3 4 5 6 7 8 9 |
<div class="row"> <div class="col-md-6 col-md-offset-3"> <div id="flash" class="alert-box alert ng-cloak" data-ng-show="flash"> {{ flash }} </div> </div> </div> |
OR template with IE Support:
1 2 3 |
<div id="template2" ng-cloak class="ng-cloak">{{ 'hello IE7' }}</div> |
But this also works on the body! 🙂
1 2 3 |
< body ng-cloak ng-app="app" > |
Nice.