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
|
Rev | Line | |
---|
[baf4cc4] | 1 | import { Injectable } from '@angular/core';
|
---|
| 2 | import {Observable} from "rxjs";
|
---|
| 3 | import {HttpClient} from "@angular/common/http";
|
---|
| 4 | import {Bus} from "../../model/Bus";
|
---|
| 5 |
|
---|
| 6 | @Injectable({
|
---|
| 7 | providedIn: 'root'
|
---|
| 8 | })
|
---|
| 9 | export 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.