tanshu
5ea09df272
Now all that is needed is to make it ready for strict compiling. Removed eslint-plugin-prettier as it is not recommended and causes errors for both eslint and prettier Bumped to v8.0.0
20 lines
659 B
TypeScript
20 lines
659 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
|
import { Observable } from 'rxjs/internal/Observable';
|
|
|
|
import { Daybook } from './daybook';
|
|
import { DaybookService } from './daybook.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class DaybookResolver implements Resolve<Daybook> {
|
|
constructor(private ser: DaybookService) {}
|
|
|
|
resolve(route: ActivatedRouteSnapshot): Observable<Daybook> {
|
|
const startDate = route.queryParamMap.get('startDate') || null;
|
|
const finishDate = route.queryParamMap.get('finishDate') || null;
|
|
return this.ser.list(startDate, finishDate);
|
|
}
|
|
}
|