first version of location service
This commit is contained in:
25
src/app/service/location.service.ts
Normal file
25
src/app/service/location.service.ts
Normal 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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user