Created
August 9, 2019 11:48
-
-
Save saimon24/da8e84b10d808ef24a34377f8da46efb to your computer and use it in GitHub Desktop.
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 { 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