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

Angular 18 abstract component with new input / output

Discussão em 'Angular' iniciado por Leogout, Setembro 30, 2024.

  1. Leogout

    Leogout Guest

    I would like to create an abstract class that some components inherit. I am using Angular 18 output() from @angular/core. I can't do that with a simple abstract class because the new output() function complains to be outside an Angular component :

    import { output } from '@angular/core';

    export abstract class AbstractGeneralCardComponent {
    seeMoreClick = output<void>();
    seeLessClick = output<void>();
    }


    Unsupported call to the output function. This function can only be used as the initializer
    of a property on a @Component or @Directive class.


    How to achieve this ?

    Continue reading...

Compartilhe esta Página