Initial Commit
This commit is contained in:
19
otis/src/app/courts/court-resolver.service.ts
Normal file
19
otis/src/app/courts/court-resolver.service.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, 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 CourtResolver implements Resolve<Court> {
|
||||
constructor(private ser: CourtService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Court> {
|
||||
const id = route.paramMap.get('id');
|
||||
return this.ser.get(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user