import { Injectable } from '@angular/core'; import { Resolve } from '@angular/router'; import { Observable } from 'rxjs'; import { Customer } from '../core/customer'; import { CustomerService } from './customer.service'; @Injectable({ providedIn: 'root', }) export class CustomerListResolver implements Resolve { constructor(private ser: CustomerService) {} resolve(): Observable { return this.ser.list(); } }