angular/angular.js — pull request #7304 by tatarmihai (2014-04-29 20:56:38+00:00)
Title: fix(ngRepeat): ensure expected order of execution for directive lifecycle functions is maintained when they are nested along with ngRepeat

Ensure that lifecycle functions of directives are called in the expected
order (i.e. compile, controller, preLink, postLink) when using them along
ngRepeat on nested elements.

Previous to this change, lifecycle functions for 'outer' directives were
called before the ones for the 'inner' directives, when ngRepeat was used
on both the 'outer' and the 'inner' elements e.g.:
```

```
resulted in the following call order:
```
foo.compile
bar.compile
foo.controller
foo.preLink
foo.postLink
bar.controller
bar.preLink
bar.postLink
```
while after applying this change, the order will be:
```
foo.compile
bar.compile
foo.controller
foo.preLink
bar.controller
bar.preLink
bar.postLink
foo.postLink
```
Motivation for the change was a means to provide a communication channel
between parant and child directives where both need to be places as a
sibbling of ngRepeat.