- add dashboard and angular routing files
- npm updates - changes in webpack.common.js
This commit is contained in:
parent
72cc5241af
commit
220944b115
17 changed files with 377 additions and 105 deletions
72
src/app/services/mock-stations.ts
Normal file
72
src/app/services/mock-stations.ts
Normal 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]
|
||||
},
|
||||
}
|
||||
];
|
26
src/app/services/station.service.ts
Normal file
26
src/app/services/station.service.ts
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue