- Timestamp:
- 01/28/22 18:45:54 (3 years ago)
- Branches:
- master
- Children:
- 6fe77af
- Parents:
- b738035
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/explore/explore-result/explore-result.component.ts
rb738035 r76712b2 1 1 import { Component, OnInit } from '@angular/core'; 2 import { ActivatedRoute } from '@angular/router'; 3 import { LocationService } from 'src/app/_services/location.service'; 2 4 3 5 @Component({ … … 8 10 export class ExploreResultComponent implements OnInit { 9 11 10 constructor() { } 12 place: string; 13 allLocation: any[] = []; 14 15 constructor(private route: ActivatedRoute, private locationService : LocationService) { 16 this.place = ''; 17 } 11 18 12 19 ngOnInit(): void { 20 this.route.queryParams 21 .subscribe(params => { 22 this.place = params.place; 23 } 24 ); 25 26 this.locationService.getAllLocationsSearch(this.place).subscribe( 27 data => { 28 this.allLocation = data; 29 } 30 ) 13 31 } 14 32
Note:
See TracChangeset
for help on using the changeset viewer.