我基本上需要寻找
true
如果你在下面注意到
this.DocumentSelected[i] = true;
在地图里。因此,我试图初始化数组并检查是否有一个值包含
真的
然后退出该方法。
DocumentSelected: any = [];
this.files.map(doc => {
if (doc.selectedDocumentItem.Id === null) {
this.DocumentSelected[i] = true;
return;
}
const datestr = (new Date(doc.selectedDate)).toUTCString();
formData.append('documentTypeId' + i++, doc.selectedDocumentItem.Id.toString());
formData.append('documentDate' + j++, datestr);
const fileEntry = doc.fileDropEntry.fileEntry as FileSystemFileEntry;
fileEntry.file((file: File) => {
formData.append('file' + k++, file, doc.name);
});
});
if (this.DocumentSelected) {
this.notify.error('Please select the Document Type');
return;
}