import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, Resolve } from '@angular/router'; import { Observable } from 'rxjs'; import { MenuEngineeringReport } from './menu-engineering-report'; import { MenuEngineeringReportService } from './menu-engineering-report.service'; @Injectable({ providedIn: 'root', }) export class MenuEngineeringReportResolver implements Resolve { constructor(private ser: MenuEngineeringReportService) {} resolve(route: ActivatedRouteSnapshot): Observable { const startDate = route.queryParamMap.get('startDate') ?? null; const finishDate = route.queryParamMap.get('finishDate') ?? null; return this.ser.get(startDate, finishDate); } }