Well, sharing the scope of the parent using normal directive techniques is still an option and doesn't require element navigation. Plus, it maintains the separation of presentation from scopes (in this case directive scope rather than controller scope). It was that against which I was evaluating ngNode. NgNode seemed interesting as more of a one-off composite-maker trick. As you point out the implementation has a flaw, but the larger question might be whether there is some way to do shorthand for one-off composite directives, or whether the existing options are at about the right level with respect to required effort to connect the pieces. On Jun 1, 2014 2:34 AM, "Gabriel Aszalos" <[email protected]> wrote:
> Thanks Daphne! While I also agree this is very interesting it is also very > flawed. It only just came to my attention that in a scenario where, for > example, you would have a button directive with an ng-node in its template, > that is used in multiple places in the same view would break the service > due to multiple ng-nodes having the same name in the same view. > > It would be nice if there was a clean way to bind $node exclusively to its > parent directive, but I doubt there is. The only way would be to add it > into Angular itself. To me it feels that something like this would be very > handy and would make code nicer, cleaner, easier to manage and faster. > > On Sunday, 1 June 2014, Daphne Maddox <[email protected]> wrote: > >> This is interesting. I'm trying to decide how I feel about it -- you're >> granting the parent directive the role of coordinating arbitrary child >> elements. I think I like it but something is nagging at me. It might take >> me a little while to put my finger on it. In your example, you don't show >> it using transclusion, is that right? >> >> >> On Saturday, May 31, 2014 2:49:00 PM UTC-7, Gabriel Aszalos wrote: >>> >>> I have developed a 314 byte helper service to help access HTML Elements >>> on template from within directives easier. Inspired from Dojo's >>> "data-dojo-attach-point". Feedback is appreciated :) >>> >>> https://github.com/backslashed/ngNode >>> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "AngularJS" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/angular/Elos01C9ftI/unsubscribe. >> To unsubscribe from this group and all its topics, 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. >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "AngularJS" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/angular/Elos01C9ftI/unsubscribe. > To unsubscribe from this group and all its topics, 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. > -- 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.
