Last change
on this file since b738035 was fa375fe, checked in by Ema <ema_spirova@…>, 3 years ago |
adding new components
|
-
Property mode
set to
100644
|
File size:
441 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | import { HttpClient } from "@angular/common/http";
|
---|
| 2 | import { Injectable } from "@angular/core";
|
---|
| 3 | import { Observable } from "rxjs";
|
---|
| 4 | import { City } from "../_models/city";
|
---|
| 5 |
|
---|
| 6 | @Injectable({
|
---|
| 7 | providedIn:'root'
|
---|
| 8 | })
|
---|
| 9 | export 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.