50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
import { NgModule } from '@angular/core';
|
|
import { RouterModule, Routes } from '@angular/router';
|
|
import { PocModelComponent } from './poc-model-component/poc-model-component';
|
|
import { HomeComponent } from './home/home.component';
|
|
import { MainLayoutComponent } from './layouts/main-layout/main-layout.component';
|
|
import { MainComponent } from './main/main.component';
|
|
import { ScheduleComponent } from './schedule/schedule.component';
|
|
import { TheaterOverlayComponent} from './theater-overlay/theater-overlay.component';
|
|
import { MovieImporterComponent } from './movie-importer/movie-importer.component';
|
|
import { AuthGuard } from './auth.guard';
|
|
import {StatisticsComponent} from './statistics/statistics.component';
|
|
|
|
const routes: Routes = [
|
|
// Seiten ohne Layout
|
|
{ path: 'landing', component: HomeComponent },
|
|
{ path: 'poc-model', component: PocModelComponent },
|
|
|
|
// Seiten mit MainLayout
|
|
{
|
|
path: '',
|
|
component: MainLayoutComponent,
|
|
children: [
|
|
{ path: '', component: MainComponent },
|
|
{ path: 'schedule', component: ScheduleComponent },
|
|
{
|
|
path: 'admin/movie-importer',
|
|
component: MovieImporterComponent,
|
|
canActivate: [AuthGuard],
|
|
data: { roles: ['admin'] }, // Array von erlaubten Rollen. Derzeit gäbe es 'admin' und 'employee'
|
|
},
|
|
{ path: 'selection/performance/:id', component: TheaterOverlayComponent},
|
|
{
|
|
path: 'admin/statistics',
|
|
component: StatisticsComponent,
|
|
canActivate: [AuthGuard],
|
|
data: { roles: ['admin'] }, // Array von erlaubten Rollen. Derzeit gäbe es 'admin' und 'employee'
|
|
},
|
|
],
|
|
},
|
|
|
|
// Fallback-Route
|
|
{ path: '**', component: HomeComponent },
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forRoot(routes)],
|
|
exports: [RouterModule],
|
|
})
|
|
export class AppRoutingModule {}
|