Files
barker/bookie/src/app/sections/section-resolver.service.ts
Amritanshu 09b762d154 Chore:
Moved to Angular 16
Moved to FastAPI 0.100.0
Moved to pydantic 2.0
2023-07-22 09:20:01 +05:30

20 lines
492 B
TypeScript

import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
import { Observable } from 'rxjs';
import { Section } from '../core/section';
import { SectionService } from './section.service';
@Injectable({
providedIn: 'root',
})
export class SectionResolver {
constructor(private ser: SectionService) {}
resolve(route: ActivatedRouteSnapshot): Observable<Section> {
const id = route.paramMap.get('id');
return this.ser.get(id);
}
}