brewman/overlord/src/app/closing-stock/closing-stock-routing.module.ts

46 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 { CostCentreListResolver } from '../cost-centre/cost-centre-list-resolver.service';
import { ClosingStockResolver } from './closing-stock-resolver.service';
import { ClosingStockComponent } from './closing-stock.component';
const closingStockRoutes: Routes = [
{
path: '',
component: ClosingStockComponent,
canActivate: [AuthGuard],
data: {
permission: 'Closing Stock',
},
resolve: {
info: ClosingStockResolver,
costCentres: CostCentreListResolver,
},
runGuardsAndResolvers: 'always',
},
{
path: ':date',
component: ClosingStockComponent,
canActivate: [AuthGuard],
data: {
permission: 'Closing Stock',
},
resolve: {
info: ClosingStockResolver,
costCentres: CostCentreListResolver,
},
runGuardsAndResolvers: 'always',
},
];
@NgModule({
imports: [CommonModule, RouterModule.forChild(closingStockRoutes)],
exports: [RouterModule],
providers: [ClosingStockResolver],
})
export class ClosingStockRoutingModule {}