I'm having some issues with my generated code. On build I get a bunch of errors like:
.../api-client-service.ts(379,59): error TS2345: Argument of type 'HttpOptions' is not assignable to parameter of type '{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: Ht...'.
Types of property 'responseType' are incompatible.
Type '"text" | "arraybuffer" | "blob" | "json"' is not assignable to type '"json"'.
Type '"text"' is not assignable to type '"json"'.
This seem to me like it's probably a versioning issue, e.g. the typescript or angular versions are wrong. I'm using Angular 4.x.x with typescript 2.4.0. I tried angular 5.x.x and TS 2.6.x and has the same issues. Maybe the code you generate targets an older angular version?
Additionally HttpObserve is not exported in /common/http. To get the generated code to build at all I've edited the HttpOptions interface as follows:
Hi,
I'm having some issues with my generated code. On build I get a bunch of errors like:
This seem to me like it's probably a versioning issue, e.g. the typescript or angular versions are wrong. I'm using Angular 4.x.x with typescript 2.4.0. I tried angular 5.x.x and TS 2.6.x and has the same issues. Maybe the code you generate targets an older angular version?
Additionally
HttpObserve
is not exported in/common/http
. To get the generated code to build at all I've edited the HttpOptions interface as follows:Any ideas?