this._reportService.getReport().subscribe(data =>
this.downloadFile(data)),//console.log(data),
error => console.log("Error downloading the file."),
() => console.info("OK");
请求准备就绪后,它将调用函数“ downloadFile”
downloadFile(data: Response){
var blob = new Blob([data], { type: 'text/csv' });
var url= window.URL.createObjectURL(blob);
window.open(url);
}
import 'rxjs/Rx' ;
它不起作用,请帮助