I am trying to apply this solution: How to download excel/Zip files in Angular 4 But I am having some errors.
The code on my service is this:
return this.http.post(endpoint,
body,
{headers: new HttpHeaders({'Accept':'application/vnd.ms-excel'}) ,
responseType: ResponseContentType.Blob})
.map(res => res.blob());
But I am getting this error:
Argument of type '{ headers: HttpHeaders; responseType: ResponseContentType.Blob; }' is not assignable to parameter of type '{ headers?: HttpHeaders; observe?: "body"; params?: HttpParams; reportProgress?: boolean; respons...'.
Types of property 'responseType' are incompatible.
Type 'ResponseContentType.Blob' is not assignable to type '"json"'.
I have no idea what to do about it :\