return this.http.get<Blob>(`reports/ruh/${firm}/${production}/${dtFrom}/${dtTo}`, { responseType: 'blob' as 'json', observe: 'response'});
}public test(): void {
this.download(3, 42, '2018-04-01', '2018-05-31')
.subscribe(
data => {
let fileName = data.headers.get('Content-Disposition');
fileName = fileName.substring(fileName.indexOf('=') + 1, fileName.length);
const blob = new Blob([data.body], { type: 'application/vnd.ms-excel'});
saveAs(blob, fileName);
}
);
}
лучше
Обсуждают сегодня