Reputation: 607
I am getting below compile error for below code,
Error,
Error TS2322 Type 'EventEmitter<{}>' is not assignable to type 'EventEmitter'. Type '{}' is not assignable to type 'number'.
@Output()
ratingChange: EventEmitter<number> = new EventEmitter();
Please suggest how to solve this? Thanks!
Upvotes: 0
Views: 4579
Reputation: 40594
Your ratingChange
is of generic EventEmitter<number>
type but the instance you are creating is of non-generic EventEmitter
. The below should work:
ratingChange: EventEmitter<number> = new EventEmitter<number>();
Upvotes: 1