Angular TS2339: Property 'subscribe' does not exist on type 'EventEmitter [duplicate]

Discussão em 'Angular' iniciado por tamilselvan s, Novembro 27, 2024.

  1. I am getting this error from event emitter @output From child component

    import { EventEmitter } from 'stream';
    .....
    @Output() selectedData = new EventEmitter<any>();
    .....
    this.selectedData .emit(data);


    Parent component

    From html file

    <html-tag-of-child (selectedData)="selectedData($event)"> </html-tag-of-child>
    .....


    from ts file

    selectedData($event){
    console.log("event", $event");
    }

    Continue reading...

Compartilhe esta Página