import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { Observable } from 'rxjs';
import { PassengerService } from '../service/passenger.service';

@Injectable({ providedIn: 'root' })
export class PassengerResolver implements Resolve<any> {

    constructor(private passengerService: PassengerService) {}

    resolve(route: ActivatedRouteSnapshot): Observable<any> | Promise<any> | any {
        return this.passengerService.getResultList();
    }
}