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

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

    When using Visual Studio Code, The IDE automatically imports EventEmitter from Node.js.

    import { EventEmitter } from "events";
    

    In this case you'll have to manually change it to angular core module

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

提交回复
热议问题