“Type 'EventEmitter' is not generic” ERROR in angular

前端 未结 4 725
鱼传尺愫
鱼传尺愫 2021-02-03 16:54

I\'m currently following a tutorial and the tutorial is making use of EventEmitter. The code goes like this

@Output() ratingClicked: EventEmitter<         


        
4条回答
  •  不知归路
    2021-02-03 17:14

    In visual studio code when your try to listen to user click event from your html file of the component

    @Output() event: EventEmitter = new EventEmitter();

    it automatically import this to the component import { EventEmitter } from '@angular/event' instead of import { EventEmitter } from '@angular/core'.

    Resource: https://ultimatecourses.com/blog/component-events-event-emitter-output-angular-2

提交回复
热议问题