Reputation: 1670
How can I detect that ng-repeat has finished writing the values into the markup? I have a lot of values and the rendering will take some time.
NG
<ul >
<li data-ng-repeat="item in values">
{{item.id}}
</li>
</ul>
Upvotes: 2
Views: 95
Reputation: 52847
Use $timeout service.
$timeout(function(){
//done rendering...
});
Pass false as the third argument to prevent another digest cycle if you don't need one:
$timeout(function(){
//done rendering...
},0,false);
You can inject the $timeout service in your controller function:
app.controller('ctrl', function($scope, $timeout){
...
});
Upvotes: 1