5

When an Angular directive contains an ngRepeat element, the ngRepeat execution appears to to occur after the containing directive's link execution.

Is there a mechanism ($watch, $observe, etc) that I can use to wire up a response after the ngRepeat execution?

Here's an example of the behavior: http://plnkr.co/edit/yBiSvveeSissU7Rik6Kp?p=preview

I want to operate in a state in the directive where the inputs are available.

My primary goal is to alter the elements of ngRepeat from the containing directive.

mhcode
  • 51
  • 2

1 Answers1

5

The typical way to determine when ng-repeat has finished is to write a directive that checks to see if $last is true. Then you can call a function (defined on a parent/ancestor scope) or emit an event, inside a $timeout callback or $evalAsync.

For more details and examples, see Calling a function when ng-repeat has finished

Community
  • 1
  • 1
Mark Rajcok
  • 362,217
  • 114
  • 495
  • 492