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.
feat(directive): Add ability to inject required controllers into the controller function #5893
Closed

Description
quick overview
You have the directives A, B and C
B requires A,
C requires B
The methods in C need to call methods in the controller of B.
The methods in the controller of B need call methods in the controller of A.
The controller of B cannot know the controller of A because it can only be passed into the link-function of B.
Actually there is a workaround that is too complicated for such an easy problem.
Even the ngModelController does use another workaround with a feature that seems to be undocumented: the binding of directive controllers to the directive-elements data property:
angular.js/src/ng/directive/input.js
Line 969 in 5adea0b