source: trip-planner-front/src/app/_services/city.service.ts@ eed0bf8

Last change on this file since eed0bf8 was fa375fe, checked in by Ema <ema_spirova@…>, 3 years ago

adding new components

  • Property mode set to 100644
File size: 441 bytes
Line 
1import { HttpClient } from "@angular/common/http";
2import { Injectable } from "@angular/core";
3import { Observable } from "rxjs";
4import { City } from "../_models/city";
5
6@Injectable({
7 providedIn:'root'
8})
9export class CityService{
10 constructor(private httpClient: HttpClient){
11 }
12
13 getAllCities():Observable<City[]>{
14 let url = "http://localhost:8080/api/cities";
15 return this.httpClient.get<City[]>(url);
16 }
17}
Note: See TracBrowser for help on using the repository browser.