brewman/overlord/src/app/daybook/daybook-resolver.service.ts
tanshu 1350870f9e Moved from tslint to eslint as tslint was depreciated.
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.
2020-10-01 21:28:12 +05:30

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);
}
}