2020-10-11 05:26:29 +00:00
|
|
|
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';
|
2019-06-13 19:02:34 +00:00
|
|
|
|
2019-08-25 09:38:59 +00:00
|
|
|
const rolesRoutes: Routes = [
|
2019-06-13 19:02:34 +00:00
|
|
|
{
|
2019-06-19 18:25:42 +00:00
|
|
|
path: '',
|
2019-06-13 19:02:34 +00:00
|
|
|
component: RoleListComponent,
|
|
|
|
canActivate: [AuthGuard],
|
|
|
|
data: {
|
2020-10-11 05:26:29 +00:00
|
|
|
permission: 'Users',
|
2019-06-13 19:02:34 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
2020-10-11 05:26:29 +00:00
|
|
|
list: RoleListResolver,
|
|
|
|
},
|
2019-06-13 19:02:34 +00:00
|
|
|
},
|
|
|
|
{
|
2019-06-19 18:25:42 +00:00
|
|
|
path: 'new',
|
2019-06-13 19:02:34 +00:00
|
|
|
component: RoleDetailComponent,
|
|
|
|
canActivate: [AuthGuard],
|
|
|
|
data: {
|
2020-10-11 05:26:29 +00:00
|
|
|
permission: 'Users',
|
2019-06-13 19:02:34 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
item: RoleResolver,
|
2020-10-11 05:26:29 +00:00
|
|
|
},
|
2019-06-13 19:02:34 +00:00
|
|
|
},
|
|
|
|
{
|
2019-06-19 18:25:42 +00:00
|
|
|
path: ':id',
|
2019-06-13 19:02:34 +00:00
|
|
|
component: RoleDetailComponent,
|
|
|
|
canActivate: [AuthGuard],
|
|
|
|
data: {
|
2020-10-11 05:26:29 +00:00
|
|
|
permission: 'Users',
|
2019-06-13 19:02:34 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
2020-10-11 05:26:29 +00:00
|
|
|
item: RoleResolver,
|
|
|
|
},
|
|
|
|
},
|
2019-06-13 19:02:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
2020-10-11 05:26:29 +00:00
|
|
|
imports: [CommonModule, RouterModule.forChild(rolesRoutes)],
|
|
|
|
exports: [RouterModule],
|
|
|
|
providers: [RoleListResolver, RoleResolver],
|
2019-06-13 19:02:34 +00:00
|
|
|
})
|
2020-10-11 05:26:29 +00:00
|
|
|
export class RolesRoutingModule {}
|