To avoid a βflash of uncompressed contentβ, use ng-bind instead of {{}} or use ng-cloak :
<span ng-cloak ng-show="show">Hello, {{name}}!</span>
If you use ng-cloak and you do not load Angular.js in the header section of your HTML, you need to add this to your CSS file and ensure that it loads at the top of the page:
[ng\:cloak], [ng-cloak], .ng-cloak { display: none; }
Please note that you need to use these directives only on the start page. Content that is pulled later (e.g. via ng-include, ng-view, etc.) will be compiled by Angular before the browser displays.
Is there a better way to load data other than ng-show / hide, into which only the corresponding section in the DOM is loaded.
Some alternatives to ng-show / ng-hide ng-include , ng-switch and (since version 1.1.5) ng-if :
<div ng-include src="someModelPropertySetToThePartialYouWantToLoadRightNow"></div>
See also https://stackoverflow.com/a/212930//ng-switch example working with ng-include.
Note that ng-switch and ng-if add / remove DOM elements, while ng-show / hide only modifies CSS (if that matters to you).
Mark Rajcok Dec 28 2018-12-12T00: 00Z
source share