21 lines
799 B
TypeScript
21 lines
799 B
TypeScript
import {Injectable} from '@angular/core';
|
|
import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router';
|
|
import {Observable} from 'rxjs/internal/Observable';
|
|
import {VoidsReprintsReport} from './voids-reprints-report';
|
|
import {VoidsReprintsReportService} from './voids-reprints-report.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class VoidsReprintsReportResolver implements Resolve<VoidsReprintsReport> {
|
|
|
|
constructor(private ser: VoidsReprintsReportService) {
|
|
}
|
|
|
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<VoidsReprintsReport> {
|
|
const startDate = route.queryParamMap.get('startDate') || null;
|
|
const finishDate = route.queryParamMap.get('finishDate') || null;
|
|
return this.ser.get(startDate, finishDate);
|
|
}
|
|
}
|