How to access host component from directive?

Discussão em 'Angular' iniciado por AngularChef, Maio 4, 2025.

  1. AngularChef

    AngularChef Guest

    Say I have the following markup:

    <my-comp myDirective></my-comp>


    Is there any way I can access the component instance from the directive?

    More specifically I want to be able to access the properties and methods of MyComponent from MyDirective, ideally without adding anything to the HTML above.

    Continue reading...

Compartilhe esta Página