I was doing an Angular tutorial, when I ran into the following error in the home.component.ts file:
No overload matches this call. Overload 1 of 5, '(observer?: PartialObserver<HttpResponse>): Subscription', gave the following error. Argument of type '(data: any[]) => void' is not assignable to parameter of type 'PartialObserver<HttpResponse>'. Property 'complete' is missing in type '(data: any[]) => void' but required in type 'CompletionObserver<HttpResponse>'. Overload 2 of 5, '(next?: (value: HttpResponse) => void, error?: (error: any) => void, complete?: () => void): Subscription', gave the following error. Argument of type '(data: any[]) => void' is not assignable to parameter of type '(value: HttpResponse) => void'. Types of parameters 'data' and 'value' are incompatible. Type 'HttpResponse' is missing the following properties from type 'any[]': length, pop, push, concat, and 26 more.
I have looked it up, but have been unable to find any solutions to this issue. I have tried to to disable strict, noImplicitAny, noImplicitReturns in the tsconfig.json, but they have not solved this issue. I would prefer if there was a solution to this issue while keeping all three settings on true in the tsconfig.json file.
Any help would be appreciated.
Thanks
EDIT: The error occurs in the home.component.ts file when dealing with the data after the AJAX call:
this.dataService.sendGetRequest().subscribe(data: any[] => {
this.products = data;
});
}