19 lines
470 B
TypeScript
19 lines
470 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Resolve } from '@angular/router';
|
|
import { Observable } from 'rxjs/internal/Observable';
|
|
|
|
import { Customer } from '../core/customer';
|
|
|
|
import { CustomerService } from './customer.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class CustomerListResolver implements Resolve<Customer[]> {
|
|
constructor(private ser: CustomerService) {}
|
|
|
|
resolve(): Observable<Customer[]> {
|
|
return this.ser.list();
|
|
}
|
|
}
|