I had angular 5.2.11, but today I updated it to 6, so when I try to build, I got an error says :
TS2345: Argument of type
Erroris not assignable to parameter of type(this: Observable<{}>, subscriber: Subscriber<{}>) => TeardownLogic. TypeErrorprovides no match for the signature(this: Observable<{}>, subscriber: Subscriber<{}>): TeardownLogic.
serviceInvoke<R,B>(baseUrl: string, relativeUrl: string, requestMethod: RequestMethod, params: {
[key: string]: any | any[]
}, body ? : B): Observable<R> {
const requestOptionsArgs = {
method: requestMethod,
params: params,
body: body
};
return this.httpClient.request(baseUrl + relativeUrl, requestOptionsArgs)
.pipe(
map((response: Response) => response.json()),
catchError((httpErrorResponse: Response) => new ErrorObservable(this.getError(httpErrorResponse)))
);
}