Skip to content

Instantly share code, notes, and snippets.

@javiergamarra
Last active February 4, 2016 20:38
Show Gist options
  • Save javiergamarra/2e0c44bd782b4ff93d71 to your computer and use it in GitHub Desktop.
Save javiergamarra/2e0c44bd782b4ff93d71 to your computer and use it in GitHub Desktop.
//Child component
@Output()
artistClicked:EventEmitter = new EventEmitter(); //does not need type
click() {
this.artistClicked.emit(this.artist);
}
//html
<spotify-artist [artist]="artista" (artistClicked)="receive($event)"></spotify-artist>
//Parent component
receive(artist) {
console.log(artist);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment