I am new to typescript, and I get this error
Type 'Observable' is not assignable to type 'IProduct[]'. Property 'includes' is missing in type 'Observable'.
My service class is :
getProducts() : Observable<IProduct[]> {
return this._http.get<IProduct[]>(this._productUrl)
.do(data=>console.log('All: ' + JSON.stringify(data)))
.catch(this.handleError);
}
private handleError(err : HttpErrorResponse){
console.log(err.message);
return Observable.throw(err.message)
}
Where is it wrong and what should I do to fix it?