swedishchamber-granprize-admin/src/app/app-routing.module.ts

71 lines
2.2 KiB
TypeScript
Raw Normal View History

2018-05-10 13:04:16 +02:00
import { NgModule } from '@angular/core';
2018-05-10 16:39:05 +02:00
import { RouterModule, Routes } from '@angular/router';
2018-05-10 13:04:16 +02:00
2018-05-10 16:39:05 +02:00
import { AwardeeListComponent } from "./awardee-list/awardee-list.component";
import { JudgeListComponent } from "./judge-list/judge-list.component";
import { AwardeeEditorComponent } from "./awardee-editor/awardee-editor.component";
import { JudgeEditorComponent } from "./judge-editor/judge-editor.component";
2018-05-11 10:46:27 +02:00
import { JudgeService } from "./shared/judge.service";
import { JudgeResolverService } from "./shared/judge-resolver.service";
import { AwardeeService } from "./shared/awardee.service";
import { AwardeeResolverService } from "./shared/awardee-resolver.service";
import { YearResolverService } from "./shared/year-resolver.service";
2018-05-12 00:19:48 +02:00
import { AuthGuardService } from "./auth/auth-guard.service";
2018-05-10 16:39:05 +02:00
const routes: Routes = [
2018-05-12 00:19:48 +02:00
{
path: 'awardees',
component: AwardeeListComponent,
resolve: {
awardees: AwardeeService,
},
canActivate: [AuthGuardService],
}, {
path: 'awardee/new',
component: AwardeeEditorComponent,
resolve: {
years: YearResolverService,
},
canActivate: [AuthGuardService],
}, {
path: 'awardee/edit/:id',
component: AwardeeEditorComponent,
resolve: {
awardee: AwardeeResolverService,
years: YearResolverService,
},
canActivate: [AuthGuardService],
}, {
path: 'judges',
component: JudgeListComponent,
resolve: {
judges: JudgeService,
},
canActivate: [AuthGuardService],
}, {
path: 'judge/new',
component: JudgeEditorComponent,
canActivate: [AuthGuardService],
}, {
path: 'judge/edit/:id',
component: JudgeEditorComponent,
resolve: {
judge: JudgeResolverService,
},
canActivate: [AuthGuardService],
}, {
path: '',
redirectTo: '/awardees',
pathMatch: 'full',
canActivate: [AuthGuardService]
},
// {path: '**', component: PageNotFoundComponent},
2018-05-10 16:39:05 +02:00
];
2018-05-10 13:04:16 +02:00
@NgModule({
2018-05-12 00:19:48 +02:00
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
2018-05-10 13:04:16 +02:00
})
2018-05-12 00:19:48 +02:00
export class AppRoutingModule {
}