I need download an excel from my backend, its returned a file.
When I do the request I get the error:
TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
My code is:
this.http.get(`${environment.apiUrl}/...`)
.subscribe(response => this.downloadFile(response, "application/ms-excel"));
I tried get and map(...) but didn't work.
Details: angular 5.2
references:
import { HttpClient } from '@angular/common/http';
import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/finally';
import 'rxjs/add/operator/map'
import 'rxjs/add/operator/catch';
Content-Type of response:
Content-Type: application/ms-excel
What's wrong?
downloadFile(....)
function as well??? – Cadence