2018-05-25 13:49:00 +00:00
|
|
|
import {NgModule} from '@angular/core';
|
|
|
|
import {CommonModule} from '@angular/common';
|
|
|
|
import {RouterModule, Routes} from '@angular/router';
|
|
|
|
import {PurchaseResolver} from './purchase-resolver.service';
|
|
|
|
import {AuthGuard} from '../auth/auth-guard.service';
|
|
|
|
import {PurchaseComponent} from './purchase.component';
|
|
|
|
|
|
|
|
const purchaseRoutes: Routes = [
|
|
|
|
{
|
2019-06-12 14:04:50 +00:00
|
|
|
path: '',
|
2018-05-25 13:49:00 +00:00
|
|
|
component: PurchaseComponent,
|
|
|
|
canActivate: [AuthGuard],
|
|
|
|
data: {
|
|
|
|
permission: 'Purchase'
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
voucher: PurchaseResolver
|
|
|
|
},
|
|
|
|
runGuardsAndResolvers: 'always'
|
|
|
|
},
|
|
|
|
{
|
2019-06-12 14:04:50 +00:00
|
|
|
path: ':id',
|
2018-05-25 13:49:00 +00:00
|
|
|
component: PurchaseComponent,
|
|
|
|
canActivate: [AuthGuard],
|
|
|
|
data: {
|
|
|
|
permission: 'Purchase'
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
voucher: PurchaseResolver
|
|
|
|
},
|
|
|
|
runGuardsAndResolvers: 'always'
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [
|
|
|
|
CommonModule,
|
|
|
|
RouterModule.forChild(purchaseRoutes)
|
|
|
|
|
|
|
|
],
|
|
|
|
exports: [
|
|
|
|
RouterModule
|
|
|
|
],
|
|
|
|
providers: [
|
|
|
|
PurchaseResolver
|
|
|
|
]
|
|
|
|
})
|
|
|
|
export class PurchaseRoutingModule {
|
|
|
|
}
|