Created
May 20, 2022 14:48
-
-
Save NyaGarcia/f7e46f4150f40fc5f1ed3309d020097d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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