import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, Resolve } from '@angular/router'; import { ProgramService } from '@features/programs/program.service'; @Injectable({ providedIn: 'root' }) export class ProgramDashboardResolver implements Resolve { constructor ( private programService: ProgramService ) { } async resolve (next: ActivatedRouteSnapshot) { const id = next.params.id; await this.programService.getProgramForDashboard(id, []); return true; } }