first version of location service

This commit is contained in:
2023-04-28 13:48:02 +02:00
parent 4ccd2fa70a
commit a49297aea5
2 changed files with 43 additions and 15 deletions

View File

@@ -0,0 +1,25 @@
import {Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {catchError, Observable} from "rxjs";
import {LocationEntity} from "../interface/LocationEntity";
const BASE_URL = "localhost:8080/progetto152/";
const GET_LOCATIONS = BASE_URL + "location";
@Injectable({
providedIn: 'root',
})
export class LocationService {
constructor(
private http: HttpClient,
) {}
getLocations(){
return this.http.get<LocationEntity[]>("/progetto152/location");
}
}