source: bus-n-go-pavel-216049/bus-n-go-frontend/src/app/services/station/station.service.ts

Last change on this file was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago

split group project and individual project into two separate folders

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