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