tanshu
1350870f9e
Added prettier and also prettied all the typescript files using prettier ESLint is using the AirBnB rules which are the most strict to lint the files.
19 lines
707 B
TypeScript
19 lines
707 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } 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, state: RouterStateSnapshot): Observable<Daybook> {
|
|
const startDate = route.queryParamMap.get('startDate') || null;
|
|
const finishDate = route.queryParamMap.get('finishDate') || null;
|
|
return this.ser.list(startDate, finishDate);
|
|
}
|
|
}
|