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

前端 未结 4 727
鱼传尺愫
鱼传尺愫 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:24

    You are probably using the node native EventEmitter from node/index.d.ts i.e.

    import { EventEmitter } from 'events';
    

    Fix

    Change the import to the one from angular:

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

提交回复
热议问题