This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Expose require
d controllers to a directive's controller #13041
Closed
Description
Currently you use controllers on directives to expose functionality. Then other directives use those controllers by supplying require
and getting the controllers in the link
function.
This feels asymmetric and a more natural way would be to allow the injection of required controllers to the directive's controller as well. That would mean that for a lot of use cases would could simply write directives with just the controller
function and no need to pass it awkwardly from link
to controller
.
I was thinking about something like providing a $requires
injectable for directive controllers that is basically an object, like $routeParams
, from controller name to controller object.
If that sounds reasonable I'll work on a pull request.
Metadata
Metadata
Assignees
Labels
No labels