I have this child class :
export class ChildService extends ParentService {
protected model = ChildModel;
}
In the parent, I would like to use the child's model as a type for the response of a http call, and for the promise !
getData(): Promise<this.model> { // doesn't work
return this.http.get(this.url)
.toPromise()
.then(response => response as this.model) // doesn't work
.catch(this.handleError);
}
Is it possible ?