diff --git a/src/app/mall-details/mall-details.page.html b/src/app/mall-details/mall-details.page.html index 308d573..8968b8d 100644 --- a/src/app/mall-details/mall-details.page.html +++ b/src/app/mall-details/mall-details.page.html @@ -11,7 +11,7 @@
{{ mallDetails.mall.mall_distance }} km
- + @@ -26,7 +26,7 @@
- @@ -64,12 +64,15 @@ -

- {{ outlet.outlet_name }} +

+
+ {{ outlet.outlet_name }} +
{{ outlet.rating }}
- +

{{ outlet.description }} diff --git a/src/app/mall-details/mall-details.page.ts b/src/app/mall-details/mall-details.page.ts index 41d257e..70183ba 100644 --- a/src/app/mall-details/mall-details.page.ts +++ b/src/app/mall-details/mall-details.page.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Location } from '@angular/common'; +import { MallService } from '../services/mall.service'; @Component({ selector: 'app-mall-details', @@ -17,13 +18,25 @@ export class MallDetailsPage implements OnInit { constructor( private route: ActivatedRoute, private router: Router, - private location: Location + private location: Location, + private mallService: MallService ) { } ngOnInit() { this.mallDetails = JSON.parse(this.route.snapshot.paramMap.get('mall')); } + toggleOutletBookmark(outlet) { + outlet.is_bookmarked = !outlet.is_bookmarked; + this.mallService.updateOutlet(outlet); + } + + toggleMallBookmark() { + this.mallDetails.mall.is_bookmarked = !this.mallDetails.mall.is_bookmarked; + console.log(this.mallDetails); + this.mallService.updateMallData(this.mallDetails); + } + back() { this.location.back(); } diff --git a/src/app/outlet-details/outlet-details.page.html b/src/app/outlet-details/outlet-details.page.html index 39559bd..f4726a6 100644 --- a/src/app/outlet-details/outlet-details.page.html +++ b/src/app/outlet-details/outlet-details.page.html @@ -14,7 +14,8 @@

-
-