Project: Mall App Client: Maiora
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

33 righe
753 B

  1. import { Component, OnInit } from '@angular/core';
  2. import { MallService, Mall } from '../services/mall.service';
  3. import { Router } from '@angular/router';
  4. @Component({
  5. selector: 'app-malls',
  6. templateUrl: './malls.page.html',
  7. styleUrls: ['./malls.page.scss'],
  8. })
  9. export class MallsPage implements OnInit {
  10. selected_tab: string = 'you';
  11. malls: Array<Mall>;
  12. constructor(
  13. private mallService: MallService,
  14. private router: Router
  15. ) { }
  16. ngOnInit() {
  17. }
  18. ionViewDidEnter() {
  19. this.mallService.getAllMalls().then((data: Array<Mall>) => {
  20. this.malls = data;
  21. });
  22. }
  23. showMallDetails(mall) {
  24. this.router.navigate(['/mall-details', { mall_id: mall.id }]);
  25. }
  26. }