Initial Commit
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { DiscountReport } from './discount-report';
|
||||
import { DiscountReportService } from './discount-report.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class DiscountReportResolver implements Resolve<DiscountReport> {
|
||||
constructor(private ser: DiscountReportService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<DiscountReport> {
|
||||
const startDate = route.queryParamMap.get('startDate') || null;
|
||||
const finishDate = route.queryParamMap.get('finishDate') || null;
|
||||
return this.ser.get(startDate, finishDate);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user