source: trip-planner-front/src/app/_services/country.service.ts@ bdd6491

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

initial commit

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