55 lines
2.2 KiB
TypeScript
55 lines
2.2 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 { PayForOrderComponent } from './pay-for-order/pay-for-order.component';
|
|
import { StatisticsComponent } from './statistics/statistics.component';
|
|
import { PricelistComponent } from './pricelist/pricelist.component';
|
|
|
|
const routes: Routes = [
|
|
// Seiten ohne Layout
|
|
{ path: 'landing', component: HomeComponent },
|
|
{ path: 'poc-model', component: PocModelComponent, data: { allowMobile: true } },
|
|
|
|
// 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: 'checkout/performance/:performanceId', component: TheaterOverlayComponent},
|
|
{ path: 'checkout/order/:orderId', component: TheaterOverlayComponent},
|
|
{ path: 'checkout/order', component: PayForOrderComponent},
|
|
{
|
|
path: 'admin/statistics',
|
|
component: StatisticsComponent,
|
|
canActivate: [AuthGuard],
|
|
data: { roles: ['admin'] }, // Array von erlaubten Rollen. Derzeit gäbe es 'admin' und 'employee'
|
|
},
|
|
{ path: 'prices', component: PricelistComponent },
|
|
],
|
|
},
|
|
|
|
// Fallback-Route
|
|
{ path: '**', component: HomeComponent },
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forRoot(routes)],
|
|
exports: [RouterModule],
|
|
})
|
|
export class AppRoutingModule {}
|