barker/bookie/src/app/sales/bills/update-table-resolver.service.ts

15 lines
455 B
TypeScript

import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
import { Observable, of as observableOf } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class UpdateTableResolver implements Resolve<boolean> {
constructor() {}
resolve(route: ActivatedRouteSnapshot): Observable<boolean> {
return route.queryParamMap.get('bill') !== null ? observableOf(false) : observableOf(true);
}
}