1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Using directive output in Drective Composition API

Discussão em 'Angular' iniciado por mnj, Setembro 23, 2024.

  1. mnj

    mnj Guest

    The Angular Docs show that you can use Directive Composition API even when directive has outputs. However, it seems that directive's outputs become component's outputs. I'd like to use directive's output within the component to which I'm attaching the directive. Is there any way to do that?

    @Component({
    standalone: true,
    selector: 'admin-menu',
    template: 'admin-menu.html',
    hostDirectives: [{
    directive: MenuBehavior,
    inputs: ['menuId'],
    outputs: ['menuClosed'],
    }],
    })
    export class AdminMenu {

    someMethod() {
    // use menuClosed here....
    }
    }

    Continue reading...

Compartilhe esta Página