Last active
July 10, 2023 11:23
-
-
Save NyaGarcia/2d1b7f59cc8938142e6bd1172574ac9f to your computer and use it in GitHub Desktop.
NgBytes Standalone Pokemon Detail
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 { RouterModule } from '@angular/router'; | |
import { Component, OnInit } from '@angular/core'; | |
import { Pokemon, PokemonService } from '../pokemon.service'; | |
import { CommonModule } from '@angular/common'; | |
import { MatButtonModule } from '@angular/material/button'; | |
@Component({ | |
selector: 'app-pokemon-detail', | |
standalone: true, | |
imports: [CommonModule, MatButtonModule, RouterModule], | |
templateUrl: './pokemon-detail.component.html', | |
styleUrls: ['./pokemon-detail.component.css'], | |
}) | |
export class PokemonDetailComponent { | |
@Input() id: string; | |
pokemon: Pokemon; | |
constructor( | |
private readonly pokemonService: PokemonService) { | |
this.pokemon = this.pokemonService.get(this.id); | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment