import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {RouterModule, Routes} from '@angular/router'; import {PaymentResolver} from './payment-resolver.service'; import {AuthGuard} from '../auth/auth-guard.service'; import {PaymentComponent} from './payment.component'; import {PaymentAccountsResolver} from './payment-accounts-resolver.service'; const paymentRoutes: Routes = [ { path: 'Payment', component: PaymentComponent, canActivate: [AuthGuard], data: { permission: 'Payment' }, resolve: { paymentAccounts: PaymentAccountsResolver, voucher: PaymentResolver }, runGuardsAndResolvers: 'paramsChange' }, { path: 'Payment/:id', component: PaymentComponent, canActivate: [AuthGuard], data: { permission: 'Payment' }, resolve: { paymentAccounts: PaymentAccountsResolver, voucher: PaymentResolver }, runGuardsAndResolvers: 'paramsChange' } ]; @NgModule({ imports: [ CommonModule, RouterModule.forChild(paymentRoutes) ], exports: [ RouterModule ], providers: [ PaymentResolver ] }) export class PaymentRoutingModule { }