source: trip-planner-front/src/app/explore/explore-result/explore-result.component.ts

Last change on this file was 6fe77af, checked in by Ema <ema_spirova@…>, 3 years ago

add location feature

  • Property mode set to 100644
File size: 1.0 KB
Line 
1import { Component, OnInit } from '@angular/core';
2import { ActivatedRoute } from '@angular/router';
3import { LocationService } from 'src/app/_services/location.service';
4
5@Component({
6 selector: 'app-explore-result',
7 templateUrl: './explore-result.component.html',
8 styleUrls: ['./explore-result.component.css']
9})
10export class ExploreResultComponent implements OnInit {
11
12 place: string;
13 allLocation: any[] = [];
14
15 constructor(private route: ActivatedRoute, private locationService : LocationService) {
16 this.place = '';
17 }
18
19 responsiveOptions:any[] = [
20 {
21 breakpoint: '1024px',
22 numVisible: 5
23 },
24 {
25 breakpoint: '768px',
26 numVisible: 3
27 },
28 {
29 breakpoint: '560px',
30 numVisible: 1
31 }
32];
33 ngOnInit(): void {
34 this.route.queryParams
35 .subscribe(params => {
36 this.place = params.place;
37 }
38 );
39
40 this.locationService.getAllLocationsSearch(this.place).subscribe(
41 res => {
42 this.allLocation = res;
43 }
44 )
45 }
46
47}
Note: See TracBrowser for help on using the repository browser.