source: bus-n-go-pavel-216049/bus-n-go-frontend/src/app/services/bus/bus.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: 467 bytes
Line 
1import { Injectable } from '@angular/core';
2import {Observable} from "rxjs";
3import {HttpClient} from "@angular/common/http";
4import {Bus} from "../../model/Bus";
5
6@Injectable({
7 providedIn: 'root'
8})
9export class BusService {
10 private _url = '/api/buses'
11 constructor(private _http: HttpClient) { }
12
13 getAll(): Observable<Bus[]> {
14 return this._http.get<Bus[]>(`${this._url}`)
15 }
16
17 getAllFree() {
18 return this._http.get<Bus[]>(`${this._url}/free`)
19 }
20}
Note: See TracBrowser for help on using the repository browser.