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,978
  • 12
  • 114
  • 156
user1477955
  • 1,652
  • 8
  • 23
  • 35

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){
   ...
});
Michael Kang
  • 52,003
  • 16
  • 103
  • 135