2

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>
Ufuk Hacıoğulları
  • 36,026
  • 11
  • 106
  • 149
user1477955
  • 1,552
  • 6
  • 21
  • 34

1 Answers1

1

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){
   ...
});
pixelbits
  • 48,078
  • 15
  • 86
  • 124