barker/bookie/src/app/roles/roles-routing.module.ts

54 lines
1.2 KiB
TypeScript
Raw Normal View History

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 = [
{
2019-06-19 18:25:42 +00:00
path: '',
component: RoleListComponent,
canActivate: [AuthGuard],
data: {
permission: 'Users',
},
resolve: {
list: RoleListResolver,
},
},
{
2019-06-19 18:25:42 +00:00
path: 'new',
component: RoleDetailComponent,
canActivate: [AuthGuard],
data: {
permission: 'Users',
},
resolve: {
item: RoleResolver,
},
},
{
2019-06-19 18:25:42 +00:00
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 {}