import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; import { ProductSaleReport } from './product-sale-report'; import { ProductSaleReportService } from './product-sale-report.service'; @Injectable({ providedIn: 'root', }) export class ProductSaleReportResolver { constructor(private ser: ProductSaleReportService) {} resolve(route: ActivatedRouteSnapshot): Observable { const startDate = route.queryParamMap.get('startDate') ?? null; const finishDate = route.queryParamMap.get('finishDate') ?? null; return this.ser.get(startDate, finishDate); } }