20 lines
754 B
TypeScript
20 lines
754 B
TypeScript
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<MenuEngineeringReport> {
|
|
constructor(private ser: MenuEngineeringReportService) {}
|
|
|
|
resolve(route: ActivatedRouteSnapshot): Observable<MenuEngineeringReport> {
|
|
const startDate = route.queryParamMap.get('startDate') ?? null;
|
|
const finishDate = route.queryParamMap.get('finishDate') ?? null;
|
|
return this.ser.get(startDate, finishDate);
|
|
}
|
|
}
|