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ı
  • 37,060
  • 12
  • 109
  • 152
user1477955
  • 1,572
  • 7
  • 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
  • 50,631
  • 15
  • 93
  • 132