Ignore:
Timestamp:
01/28/22 18:45:54 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
6fe77af
Parents:
b738035
Message:

search all locations by city or region

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/src/app/explore/explore-result/explore-result.component.ts

    rb738035 r76712b2  
    11import { Component, OnInit } from '@angular/core';
     2import { ActivatedRoute } from '@angular/router';
     3import { LocationService } from 'src/app/_services/location.service';
    24
    35@Component({
     
    810export class ExploreResultComponent implements OnInit {
    911
    10   constructor() { }
     12  place: string;
     13  allLocation: any[] = [];
     14
     15  constructor(private route: ActivatedRoute, private locationService : LocationService) {
     16    this.place = '';
     17  }
    1118
    1219  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    )
    1331  }
    1432
Note: See TracChangeset for help on using the changeset viewer.