Project: Mall App Client: Maiora
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

malls.page.ts 753 B

1234567891011121314151617181920212223242526272829303132
  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. }