Answer the question
In order to leave comments, you need to log in
Why does the TypeScript compiler swear at the absence of a class property, if this property is present in it?
Why does the TypeScript compiler swear at the absence of a class property, if this property is present in it?
Property 'path' does not exist on type 'TutorService'.
this.tutorServiceService.getTutorServices()
.then(tutorServices => {
tutorServices.find(s => `/service/${s.path}` == this.router.url) // Property 'path' does not exist on type 'TutorService'.
});
getTutorServices(): Promise<TutorService[]> {
return this.http.get(this.url)
.toPromise()
.then(response => response.json().data as TutorService[])
.catch(this.handleError);
}
export class TutorService {
id: number;
title: string;
menuTitle: string;
sinosis: string;
text: string;
path: string;
}
Answer the question
In order to leave comments, you need to log in
Weird. I reloaded Webpack (or rather the Angular2 compiler - ng) and the error no longer bothers me. How so???
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question