Hi,
I have error in the below code but not sure where to look for error!
Class 'PropertyDetailResolverService' incorrectly implements interface 'ResolveFn<Property>'.
Type 'PropertyDetailResolverService' provides no match for the signature '(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Property | Observable<Property> | Promise<...>'.ts(2420)
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, ResolveFn, RouterStateSnapshot } from '@angular/router';
import { Property } from '../../model/property';
import { HousingService } from '../../services/housing.service';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class PropertyDetailResolverService implements ResolveFn<Property>{
constructor(private housingService: HousingService) { }
resolvefn(route: ActivatedRouteSnapshot, state: RouterStateSnapshot):
Observable<Property>|Property {
const propId = route.params['id'];
return this.housingService.getProperty(propId)
}
}