Skip to content
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
@ghost

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,

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions