Skip to content

Instantly share code, notes, and snippets.

@saimon24
Created August 9, 2019 11:48
Show Gist options
  • Save saimon24/da8e84b10d808ef24a34377f8da46efb to your computer and use it in GitHub Desktop.
Save saimon24/da8e84b10d808ef24a34377f8da46efb to your computer and use it in GitHub Desktop.
import { PokemonService } from './../services/pokemon.service';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-details',
templateUrl: './details.page.html',
styleUrls: ['./details.page.scss'],
})
export class DetailsPage implements OnInit {
details: any;
slideOpts = {
autoplay: {
delay: 1000,
disableOnInteraction: false
}
};
constructor(private pokeService: PokemonService, private route: ActivatedRoute) { }
ngOnInit() {
let index = this.route.snapshot.paramMap.get('index');
this.pokeService.getPokeDetails(index).subscribe(details => {
this.details = details;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment