This is my first time posting on this list, so please go easy on me. :-)
I've been loving Angular. I've used it for a few small projects and was impressed enough to start using it in a large-scale project that I'm porting from Backbone.
I'm trying to understand the order of compilation, pre-linking, and post-linking in directives. Specifically, the expected order of operations seems to break down when using an ng-repeat inside of another directive.
I used this Plunker as a reference to understand when the compilation/linking phases happen relative to one another:
That I was able to essentially replicate in JSFiddle:
But when I modified that JSFiddle to include an ng-repeat, the order changes so that the parent's post-link happens *before* the children's linking functions.
So my question is: Is there a consistently good way to understand when the linking functions for nested directives have completed?
(My use case involves building a directive that is aware of its child elements, which may be dynamically changing. So far the only way I can make it work is to use a $timeout that occasionally looks at the DOM beneath the parent directive's element to see if it's consistent or not with some aspect of scope. If the DOM and scope aren't in alignment then the parent directive updates itself. This unfortunately requires a very custom solution in each case and is results in brittle code. Maybe there's a better way to do this?)
Thanks!
Chris