Initial Commit
This commit is contained in:
18
otis/src/app/offices/office-list-resolver.service.ts
Normal file
18
otis/src/app/offices/office-list-resolver.service.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { Office } from '../core/office';
|
||||
|
||||
import { OfficeService } from './office.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class OfficeListResolver implements Resolve<Office[]> {
|
||||
constructor(private ser: OfficeService) {}
|
||||
|
||||
resolve(): Observable<Office[]> {
|
||||
return this.ser.list();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user