public downloadFile2(bundleIds: Array<String>, langIds: Array<String>): Observable<Blob> {
let options = new RequestOptions({ responseType: ResponseContentType.Blob });
return this.http.get(this.url, options).map(res => res.blob());
}
It doesn't compile and flags the following error message at the last line (options):
[ts]Argument of type 'RequestOptions' is not assignable to parameter of type '{ headers?: HttpHeaders; observe?: "body"; params?: HttpParams; reportProgress?: boolean; respons...'. Types of property 'headers' are incompatible. Type 'Headers' is not assignable to type 'HttpHeaders'. Property 'headers' is missing in type 'Headers'.
What seems to happen is that HttpClient requires HttpHeaders parameters while this example is using Headers. Could someone please provide me with a working example of downloading an Excel file or, at least, how to solve the error above ?
Many thanks in advance,
Nicolas