Files
barker/bookie/src/app/guest-book/guest-book-detail-resolver.service.ts
tanshu d677cfb1ea Blacked and isorted the python files
Prettied and eslinted the typescript/html files
2020-10-11 10:56:29 +05:30

19 lines
566 B
TypeScript

import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
import { Observable } from 'rxjs/internal/Observable';
import { GuestBook } from './guest-book';
import { GuestBookService } from './guest-book.service';
@Injectable({
providedIn: 'root',
})
export class GuestBookDetailResolver implements Resolve<GuestBook> {
constructor(private ser: GuestBookService) {}
resolve(route: ActivatedRouteSnapshot): Observable<GuestBook> {
const id = route.paramMap.get('id');
return this.ser.get(id);
}
}