I am currently working on implementing a specific behavior using AngularJS components.
<parent-component>
<reusable-child-component></reusable-child-component>
</parent-component>
My goal is to pass the parent's controller to a reusable child component. I am aware that this can be achieved by using the require attribute, but it requires specifying the name of the parent's component (e.g., require : '^parentComponent').
Is there a way for me to dynamically pass the controller to the child component? So that the child component can receive any parent controller dynamically.
<parent-component>
<reusable-child-component></reusable-child-component>
</parent-component>
<parent2-component>
<reusable-child-component></reusable-child-component>
</parent2-component>
I would greatly appreciate any suggestions or guidance, especially if provided in TypeScript.