Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Last active June 27, 2022 08:57
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/96dc6554ba14697982d9ecbfcda5a601 to your computer and use it in GitHub Desktop.
Save NyaGarcia/96dc6554ba14697982d9ecbfcda5a601 to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Observable } from 'rxjs';
import { PokedexFirestoreService } from 'src/app/core/pokedex-firestore.service';
import { Pokemon } from './interfaces/pokemon.interface';
@Component({
selector: 'app-pokemon',
templateUrl: './pokemon.component.html',
styleUrls: ['./pokemon.component.scss'],
})
export class PokemonComponent implements OnInit {
pokemon$: Observable<Pokemon[]>;
selectedPokemon: Pokemon;
constructor(
private readonly pokedexService: PokedexFirestoreService,
private readonly dialog: MatDialog
) {}
ngOnInit(): void {
this.pokemon$ = this.pokedexService.getAll();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment