import { Injectable } from '@angular/core'; import { Resolve } from '@angular/router'; import { PolicyService } from '@core/services/policy.service'; import { PaymentProcessingService } from '../payment-processing.service'; @Injectable({ providedIn: 'root' }) export class PaymentProcessingResolver implements Resolve { constructor ( private paymentProcessingService: PaymentProcessingService, private policyService: PolicyService ) { } async resolve () { if (this.policyService.processing.canManageProcessing()) { await this.paymentProcessingService.getProcessingStats(); } } }