I sometimes use lodash's _.bindAll() to ensure my controller's *this* context is maintained when I pass the method thru a directive &attr binding. It feels wonky to me, is there another way?
Plunker <https://plnkr.co/edit/jHyUm3?p=preview> Have commonly seen this need in master-detail interfaces. Imagine: a *list* component, a *list-item* component, and an *item-detail* component. Demeter would argue that *item-item* doesn't need to know the extent of *item-detail*. Let's say it just needs to bind to a single prop, and emit an event when it gets special attention (like a click). It's the *list* component's job to assign to *item-detail*. When implementing this with &attr bindings, i feel that _.bindAll and the proxy-like overloading I'm doing in the plunker is unwanted complexity or anti-pattern. Anybody have a favorite way of doing this? Have always meant to bounce this off the mailing list. Finally got round to it. Thanks in advance. -- 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 https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
