Programming Language: Typescript – written as .ts files
Development Framework: Angular 4
I'm currently working on an application that is supposed to add chips (similar to tags in Angular 1) whenever a user types something into the input box and hits the "Add Chip" button.
My problem revolves around two variables I have defined, specifically addSelectedCode and addCode:
@Input() addSelectedCode: string[];
@Output() addCode: EventEmitter<string[]> = new EventEmitter;
Every time I attempt to assign one variable to the other, I encounter an error.
this.addCode = this.addSelectedCode;
The error message looks like this:
Type 'string[]' is not assignable to EventEmitter 'string[]'. Property __isAsync is missing in string[].
I am unsure of how to troubleshoot and fix this issue. Does anyone have any insights or solutions they can share?
SOLUTION FOUND: Update your code with this line, this.addCode.emit(this.selectedCode);