Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## pt2
- ```
- import { PokemonService } from "./pokemon/pokemon.service";
- ```
- ## pt3
- ```
- export class ListComponent implements OnInit {
- pokemonList;
- constructor(private pokemonService: PokemonService) {}
- ngOnInit() {
- this.pokemonService.list().then((data) => {
- this.pokemonList = data;
- });
- }
- }
- ```
- ## pt4
- ```
- <ScrollView>
- <FlexboxLayout class="container">
- <Image *ngFor="let pokemon of pokemonList"
- [src]="pokemon.sprite"
- ></Image>
- </FlexboxLayout>
- </ScrollView>
- ```
- ## fl5
- ```
- .container {
- flex-wrap: wrap;
- justify-content: space-around;
- }
- ```
- ## pt6
- ```
- (tap)="onTap($event, pokemon)"
- ```
- ## pt7
- ```
- import { RouterExtensions } from "nativescript-angular/router";
- ```
- ## pt8
- ```
- onTap(event, pokemon) {
- this.router.navigate(["/detail", pokemon], {
- });
- }
- ```
- ```
- transition: {
- name: "curlUp",
- duration: 500
- }
- ```
- ## pt9
- ```
- <FlexboxLayout justifyContent="center">
- <Image [src]="pokemon.sprite"></Image>
- </FlexboxLayout>
- ```
- ## pt10
- ```
- import * as SocialShare from "nativescript-social-share";
- ```
- ## pt11
- ```
- <ActionItem text="Share" (tap)="share(event, pokemon)" android.systemIcon="ic_menu_share_holo_dark" ios.systemIcon="9" ios.position="right"></ActionItem>
- ```
- ## pt12
- ```
- share(event, pokemon) {
- SocialShare.shareImage(pokemon.sprite);
- }
- ```
- ## pt13
- ```
- var explosion = require("nativescript-explosionfield");
- ```
- ## pt14
- ```
- explosion.explode(event.view);
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement