Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component } from '@angular/core';
- import { Pokemon } from './pokemon';
- import { POKEMONS } from './mock-pokemons';
- import { Router } from '@angular/router';
- @Component({
- selector: 'list-pokemon',
- templateUrl: './app/list-pokemon.component.html'
- })
- export class ListPokemonComponent {
- private Pokemon[]: null;
- constructor(private router: Router){ }
- ngOnInit(){
- this.pokemons = POKEMONS;
- }
- selectPokemon(pokemon: Pokemon){
- let link = ['/pokemon', pokemon.id];
- this.router.navigate(link);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement