Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created May 20, 2022 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NyaGarcia/f7e46f4150f40fc5f1ed3309d020097d to your computer and use it in GitHub Desktop.
Save NyaGarcia/f7e46f4150f40fc5f1ed3309d020097d to your computer and use it in GitHub Desktop.
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Pokemon } from '../../interfaces/pokemon.interface';
@Component({
selector: 'app-detail',
templateUrl: './detail.component.html',
styleUrls: ['./detail.component.scss'],
})
export class DetailComponent implements OnInit {
@Input() pokemon: Pokemon;
@Output() updatePokemon = new EventEmitter<void>();
@Output() deletePokemon = new EventEmitter<void>();
constructor() {}
ngOnInit(): void {}
update() {
this.updatePokemon.emit();
}
delete() {
this.deletePokemon.emit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment