Do I need to put AngularJS in the <head> if I want to hide {{ xxx }} from showing on my page? -
i have html this:
<div id="top" ng-hide="app.stateservice.displaymodal"> <div>{{ app.userservice.data.name }}</div> </div> // body html here. no images loaded. divs <script src="scripts/jquery-2.1.1.min.js"></script> <script src="/scripts/angular.js"></script>
now page briefly shows {{ app.userservice.data.name }}.
if want not show have have angularjs in head of document? reason placed angularjs @ end because wanted have page appear possible.
can advise me , tell me how can make {{ xxx }} hidden when page first loads up.
you use ng-cloak
hide elements until compiled.
<div id="top" ng-cloak ng-hide="app.stateservice.displaymodal"> <div>{{ app.userservice.data.name }}</div> </div>
the css rules hide elements ng-cloak
added automatically angular.js
.
if isn't fast enough add css rules @ head:
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }
or using angular-csp.css file.
also see: ngcloak documentation
Comments
Post a Comment