import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, Resolve } from '@angular/router'; import { ApplicantManagerService } from './applicant-manager.service'; @Injectable({ providedIn: 'root' }) export class ApplicantProfileResolver implements Resolve { constructor ( private applicantManagerService: ApplicantManagerService ) { } async resolve (next: ActivatedRouteSnapshot) { const id = next.params.id; await this.applicantManagerService.setApplicantProfileDetails(id); return true; } }