add routing to project

This commit is contained in:
tim-herbst 2020-12-20 17:20:32 +01:00 committed by Tim Herbst
parent 95baf1f9b7
commit ba0f7b5e86
5 changed files with 11 additions and 53 deletions

View File

@ -1,10 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {MapComponent} from './map/map.component';
import {DashboardComponent} from './dashboard/dashboard.component';
const routes: Routes = [];
const routes: Routes = [
{path: '', redirectTo: 'map', pathMatch: 'full'},
{path: 'map', component: MapComponent},
{path: 'dashboard/:id', component: DashboardComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
export class AppRoutingModule {
}

View File

@ -1 +0,0 @@
<b>{{station.commonName}}</b>

View File

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PopupComponent } from './popup.component';
describe('PopupComponent', () => {
let component: PopupComponent;
let fixture: ComponentFixture<PopupComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PopupComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PopupComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,23 +0,0 @@
import {Component, OnInit} from '@angular/core';
import {BikeStation, IBikeStation} from '../../service/domain/bike-station';
@Component({
selector: 'app-popup',
templateUrl: './popup.component.html',
styleUrls: ['./popup.component.scss']
})
export class PopupComponent implements OnInit {
station: IBikeStation;
constructor() {
}
ngOnInit(): void {
}
public bindStation(bikeStation: IBikeStation): void {
this.station = bikeStation;
console.log(this.station);
}
}