import { Injectable } from '@angular/core'; import { Resolve } from '@angular/router'; import { ProgramAutomationService } from '../program-automation.service'; @Injectable({ providedIn: 'root' }) export class ProgramAutomationResolver implements Resolve { constructor ( private programAutomationService: ProgramAutomationService ) { } async resolve () { await this.programAutomationService.setAllProgramAutomationRules(); } }