- add dashboard and angular routing files

- npm updates
- changes in webpack.common.js
This commit is contained in:
Arno Kaimbacher 2021-08-27 16:11:29 +02:00
parent 72cc5241af
commit 220944b115
17 changed files with 377 additions and 105 deletions

View file

@ -0,0 +1,26 @@
import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
import { Station } from 'shared/models/station';
import { STATIONS } from './mock-stations';
@Injectable({
providedIn: 'root'
})
export class StationService {
constructor() { }
getStations(): Observable<Station[]> {
const stations = of(STATIONS);
// this.messageService.add('HeroService: fetched heroes');
return stations;
}
getStation(id: string): Observable<Station> {
// For now, assume that a hero with the specified `id` always exists.
// Error handling will be added in the next step of the tutorial.
const station = STATIONS.find(h => h.id === id)!;
// this.messageService.add(`HeroService: fetched hero id=${id}`);
return of(station);
}
}