19 lines
442 B
TypeScript
19 lines
442 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Resolve } from '@angular/router';
|
|
import { Observable } from 'rxjs';
|
|
|
|
import { Printer } from '../core/printer';
|
|
|
|
import { PrinterService } from './printer.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class PrinterListResolver implements Resolve<Printer[]> {
|
|
constructor(private ser: PrinterService) {}
|
|
|
|
resolve(): Observable<Printer[]> {
|
|
return this.ser.list();
|
|
}
|
|
}
|