As the others mentioned, use ng-cloak but also add the following to your CSS if it is the first to load in your page.
[ng:cloak],[ng-cloak],.ng-cloak{display:none !important}
This will ensure that your div template is hidden. Below that div template, add something like
Loading...
The assignment of the $root.initializing.status with cause a true value for ng-hide.
Here is the jsfiddle and the following is the code:
HTML:
<div ng-controller='Ctrl'>
<div id='message'>{{$root.initializing.status}}</div>
<div ng-hide="$root.initializing.status">Loading...</div>
</div>
JS:
function Ctrl($timeout, $scope) {
///simulating loading
$timeout(function () {
$scope.$root = {
initializing: {
status: 'Complete!'
}
}
}, 2000);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…