我的url返回了一个JSON响应,但在代码中我无法获得它,你能建议我在哪里以及如何获得它吗?
onUploadOutput(output: UploadOutput): void {
if (output.type === 'allAddedToQueue') {
const event: UploadInput = {
type: 'uploadAll',
url: this.url,
method: 'POST',
data: {foo: 'bar'}
};
this.uploadInput.emit(event);
........
} else if (output.type === 'done') {
this.files.forEach(file => {
console.log('ciao'); //DIDN'T WORK
console.log(file.response); //DIDN'T WORK
this.uploadInput.emit(file.response);
});
}
this.files = this.files.filter(file => file.progress.status !== UploadStatus.Done);
}
}发布于 2019-11-14 18:12:37
找到解决方案,编辑ngx-uploader模块,修改ngx-uploader.js中第236行的代码:
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
/** @type {?} */https://stackoverflow.com/questions/54707164
复制相似问题