Today found in the page using the angular data binding JS rendering is executed too quickly, to the DOM are not ready, directly on the error, then check the information
first: We can use ng-init command to help us achieve
// html
<div ng-init="init()"></div>
$scope.init = function() {
// to do
}
The second: If the license, you can also use setTimeOut can be achieved, but this is not recommended, because the use of the time difference is not very strict
$scope.init = function() {
// to do
setTimeOut(function(){
XXXXX;
},1000)
}
$scope.init ();