emit an event code example
Example 1: angular event emitter
@Output() open: EventEmitter<any> = new EventEmitter();
toggel() {
this.open.emit(null);
}
Example 2: emitter angular
<component
(open)="open($event)"
></component>
Example 3: javascript emit event
const event = new Event('build');
// Listen for the event.
elem.addEventListener('build', function (e) { /* ... */ }, false);
// Dispatch the event.
elem.dispatchEvent(event);