This repository was archived by the owner on Apr 12, 2024. It is now read-only.

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.
more details
http://stackoverflow.com/questions/21231294/angularjs-inject-required-directive-controller-into-the-controller-instead-of-t/21231428
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:
|
var parentForm = $element.inheritedData('$formController') || nullFormCtrl, |