import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; 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"; 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"; const routes: Routes = [ { path: 'awardees', component: AwardeeListComponent, resolve: { awardees: AwardeeService, } // canActivate: [AuthGuardService, RoleGuardService], }, { path: 'awardee/new', component: AwardeeEditorComponent, resolve: { years: YearResolverService, } // canActivate: [AuthGuardService, RoleGuardService], }, { path: 'awardee/edit/:id', component: AwardeeEditorComponent, resolve: { awardee: AwardeeResolverService, years: YearResolverService, } // canActivate: [AuthGuardService, RoleGuardService], }, { path: 'judges', component: JudgeListComponent, resolve: { judges: JudgeService, } // canActivate: [AuthGuardService, RoleGuardService], }, { path: 'judge/new', component: JudgeEditorComponent, // canActivate: [AuthGuardService, RoleGuardService], }, { path: 'judge/edit/:id', component: JudgeEditorComponent, resolve: { judge: JudgeResolverService, } // canActivate: [AuthGuardService, RoleGuardService], } ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule {}