Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. ## pt2
  2.  
  3. ```
  4. import { PokemonService } from "./pokemon/pokemon.service";
  5. ```
  6.  
  7. ## pt3
  8.  
  9. ```
  10. export class ListComponent implements OnInit {
  11. pokemonList;
  12.  
  13. constructor(private pokemonService: PokemonService) {}
  14.  
  15. ngOnInit() {
  16. this.pokemonService.list().then((data) => {
  17. this.pokemonList = data;
  18. });
  19. }
  20. }
  21. ```
  22.  
  23. ## pt4
  24.  
  25. ```
  26. <ScrollView>
  27. <FlexboxLayout class="container">
  28. <Image *ngFor="let pokemon of pokemonList"
  29. [src]="pokemon.sprite"
  30. ></Image>
  31. </FlexboxLayout>
  32. </ScrollView>
  33. ```
  34.  
  35. ## fl5
  36.  
  37. ```
  38. .container {
  39. flex-wrap: wrap;
  40. justify-content: space-around;
  41. }
  42. ```
  43.  
  44. ## pt6
  45.  
  46. ```
  47. (tap)="onTap($event, pokemon)"
  48. ```
  49.  
  50. ## pt7
  51.  
  52. ```
  53. import { RouterExtensions } from "nativescript-angular/router";
  54. ```
  55.  
  56. ## pt8
  57.  
  58. ```
  59. onTap(event, pokemon) {
  60. this.router.navigate(["/detail", pokemon], {
  61.  
  62. });
  63. }
  64. ```
  65.  
  66. ```
  67. transition: {
  68. name: "curlUp",
  69. duration: 500
  70. }
  71. ```
  72.  
  73.  
  74. ## pt9
  75.  
  76. ```
  77. <FlexboxLayout justifyContent="center">
  78. <Image [src]="pokemon.sprite"></Image>
  79. </FlexboxLayout>
  80. ```
  81.  
  82. ## pt10
  83.  
  84. ```
  85. import * as SocialShare from "nativescript-social-share";
  86. ```
  87.  
  88. ## pt11
  89.  
  90. ```
  91. <ActionItem text="Share" (tap)="share(event, pokemon)" android.systemIcon="ic_menu_share_holo_dark" ios.systemIcon="9" ios.position="right"></ActionItem>
  92. ```
  93.  
  94. ## pt12
  95.  
  96. ```
  97. share(event, pokemon) {
  98. SocialShare.shareImage(pokemon.sprite);
  99. }
  100. ```
  101.  
  102. ## pt13
  103.  
  104. ```
  105. var explosion = require("nativescript-explosionfield");
  106. ```
  107.  
  108. ## pt14
  109.  
  110. ```
  111. explosion.explode(event.view);
  112. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement