Skip to content

Instantly share code, notes, and snippets.

@karthikchintala1
Last active May 31, 2022 09:17
Show Gist options
  • Save karthikchintala1/dea7fc6586a10b128ec39640145a1317 to your computer and use it in GitHub Desktop.
Save karthikchintala1/dea7fc6586a10b128ec39640145a1317 to your computer and use it in GitHub Desktop.
using @output with EventEmitter in angular
//import Output, EventEmitter from angular core
import {Component, Input, Output, EventEmitter} from '@angular/core'
//define the event emitter
@Output()
change: EventEmitter<number> = new EventEmitter<number>();
//emit the event with the above change event
this.change.emit(11); //11 will be emitted to the parent
@pavani2352
Copy link

@output()
change: EventEmitter = new EventEmitter();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment