have you considered using a 'pre' link function in the parent so that you can populate the scope before the child directives fire?
http://plnkr.co/edit/iOCoUh1QdVEGklXcFMR8?p=preview On Wednesday, July 9, 2014 4:25:55 PM UTC-4, xrd wrote: > > Is there a way to identify the instance of each directive? > > I want to build a set of directives where child directives "know" the name > of their parent directives. I was envisioning knowing the parent ID and > then $broadcast'ing the ID. Then, inside my child directive, I was assuming > if I listened for that even using $on, that I could retrieve the ID and > associate it. Clearly I don't understand the directive lifecycle and > instantiation. > > I built a little plunkr to explain: > > http://plnkr.co/edit/QmkzHXeyN1l18LVBgZe8?p=preview > > My desired output would be to see the same ID for the first three and then > another ID for the next three. For example: > > foo (parent: 002) > foo (parent: 002) > foo (parent: 002) > foo (parent: 006) > foo (parent: 006) > foo (parent: 006) > > Any ideas? > > Chris > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
