Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Last active July 10, 2023 11:23
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/2d1b7f59cc8938142e6bd1172574ac9f to your computer and use it in GitHub Desktop.
Save NyaGarcia/2d1b7f59cc8938142e6bd1172574ac9f to your computer and use it in GitHub Desktop.
NgBytes Standalone Pokemon Detail
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