54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import { CommonModule } from '@angular/common';
|
|
import { NgModule } from '@angular/core';
|
|
import { RouterModule, Routes } from '@angular/router';
|
|
|
|
import { AuthGuard } from '../auth/auth-guard.service';
|
|
|
|
import { SectionDetailComponent } from './section-detail/section-detail.component';
|
|
import { SectionListResolver } from './section-list-resolver.service';
|
|
import { SectionListComponent } from './section-list/section-list.component';
|
|
import { SectionResolver } from './section-resolver.service';
|
|
|
|
const sectionsRoutes: Routes = [
|
|
{
|
|
path: '',
|
|
component: SectionListComponent,
|
|
canActivate: [AuthGuard],
|
|
data: {
|
|
permission: 'Sections',
|
|
},
|
|
resolve: {
|
|
list: SectionListResolver,
|
|
},
|
|
},
|
|
{
|
|
path: 'new',
|
|
component: SectionDetailComponent,
|
|
canActivate: [AuthGuard],
|
|
data: {
|
|
permission: 'Sections',
|
|
},
|
|
resolve: {
|
|
item: SectionResolver,
|
|
},
|
|
},
|
|
{
|
|
path: ':id',
|
|
component: SectionDetailComponent,
|
|
canActivate: [AuthGuard],
|
|
data: {
|
|
permission: 'Sections',
|
|
},
|
|
resolve: {
|
|
item: SectionResolver,
|
|
},
|
|
},
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [CommonModule, RouterModule.forChild(sectionsRoutes)],
|
|
exports: [RouterModule],
|
|
providers: [SectionListResolver, SectionResolver],
|
|
})
|
|
export class SectionsRoutingModule {}
|