An error occurred: @Output not initialized

Solution 1:

To make your code work in a stackblitz, I had to replace

import { EventEmitter } from 'events';

with

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

Solution 2:

Had the same error,

Import was correct like

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

But the variable definition was wrong:

@Output() onFormChange: EventEmitter<any>;

Should be:

@Output() onFormChange: EventEmitter<any> = new EventEmitter();

Solution 3:

In your component just use core angular module. Simply put this code at beginning of file.

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