- 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,72 @@
import { Station } from '../../shared/models/station';
export const STATIONS: Station[] = [
{
id: '11',
label: 'Dr Nice',
geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
}
},
{
id: '12', label: 'Narco', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
}
},
{
id: '13', label: 'Bombasto', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
}
},
{
id: '14', label: 'Celeritas', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
}
},
{
id: '15', label: 'Magneta', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
}
},
{
id: '16', label: 'RubberMan', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
},
},
{
id: '16', label: 'RubberMan', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
},
},
{
id: '17', label: 'Dynama', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
},
},
{
id: '18', label: 'Dr IQ', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
},
},
{
id: '19', label: 'Magma', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
},
},
{
id: '20', label: 'Tornado', geometry: {
"type": "Point",
"coordinates": [125.6, 10.1]
},
}
];

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);
}
}