source: trip-planner-front/src/app/_services/region.service.ts

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

search all locations by city or region

  • Property mode set to 100644
File size: 618 bytes
Line 
1import { HttpClient } from "@angular/common/http";
2import { Injectable } from "@angular/core";
3import { Observable } from "rxjs";
4import { Region } from "../_models/region";
5
6@Injectable({
7 providedIn: 'root'
8})
9export class RegionService{
10 constructor(private httpClient: HttpClient){
11 }
12
13 getAllRegions():Observable<Region[]>{
14 let url = "http://localhost:8080/api/regions";
15 return this.httpClient.get<Region[]>(url);
16 }
17
18 getAllCitiesAndRegions() :Observable<string[]>{
19 let url = "http://localhost:8080/api/places";
20 return this.httpClient.get<string[]>(url);
21 }
22}
Note: See TracBrowser for help on using the repository browser.