I have a child component where I use a dropdown from primeng plug in to send its value to the parent whenever the user changes the selection. I use the EventEmitter.emit() function to emit a value of type Solution. The Solution is an interface defined by me.
Here is how I defined the emitter:
@Output('solutionChange') selectedSolution: EventEmitter<Solution> = new EventEmitter<Solution>();
Here is how I called the emitter:
public onSolutionChange(args) {
let solution: Solution = args.value as Solution;
this.selectedSolution.emit(solution);
}
The problem is when I call the emit() function it gives the error TypeError: emit is not a function.
I already tried to change the definition of the emitter to @Output('solutionChange') selectedSolution: EventEmitter<any> = new EventEmitter<any>();
because the args.value is an any type coming from backend, but still the same error. I also tried replacing the emit() function with the next() function.