54 lines
1.2 KiB
TypeScript
54 lines
1.2 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 { RoleDetailComponent } from './role-detail/role-detail.component';
|
|
import { RoleListResolver } from './role-list-resolver.service';
|
|
import { RoleListComponent } from './role-list/role-list.component';
|
|
import { RoleResolver } from './role-resolver.service';
|
|
|
|
const rolesRoutes: Routes = [
|
|
{
|
|
path: '',
|
|
component: RoleListComponent,
|
|
canActivate: [AuthGuard],
|
|
data: {
|
|
permission: 'Users',
|
|
},
|
|
resolve: {
|
|
list: RoleListResolver,
|
|
},
|
|
},
|
|
{
|
|
path: 'new',
|
|
component: RoleDetailComponent,
|
|
canActivate: [AuthGuard],
|
|
data: {
|
|
permission: 'Users',
|
|
},
|
|
resolve: {
|
|
item: RoleResolver,
|
|
},
|
|
},
|
|
{
|
|
path: ':id',
|
|
component: RoleDetailComponent,
|
|
canActivate: [AuthGuard],
|
|
data: {
|
|
permission: 'Users',
|
|
},
|
|
resolve: {
|
|
item: RoleResolver,
|
|
},
|
|
},
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [CommonModule, RouterModule.forChild(rolesRoutes)],
|
|
exports: [RouterModule],
|
|
providers: [RoleListResolver, RoleResolver],
|
|
})
|
|
export class RolesRoutingModule {}
|