You can "publish" directive's controller to the scope and use it in ng-controller. See this example http://plnkr.co/edit/LY9nTMCRGHst233mR1pi?p=preview
Basically: 1. you have to create a directive with controller 2. in this controller you could define directive API which can be accessed outside - in other directives (with `require` configuration) or ng-controllers 3. In linking function you could publish this controller to the parent controller's scope On Tuesday, June 3, 2014 4:12:29 PM UTC+2, Sander Elias wrote: > > Hi All, > > As an sample to his question, I created this small plunk > <http://goo.gl/J1ANqq> to show a way on how this can be done. It is a > sort of discussion starter. > For myself, I think this is a very angular way to expose selected parts to > the view and to the scopes inside the directive. > also child-directives can pick up the controller and use the exposed API. > > Did I miss some serious drawbacks in this approach? > > Regards > Sander > -- 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.
