angular7 - 如何在不使用ng2-file uploader之类的插件的情况下以角度上传多个文件
问题描述
想要使用除 ng2 文件上传器之外的不同表单控件在同一表单中上传多个文件。
我在单个表单控件中获得多个文件上传器,但我想在同一个表单 component.html 中以不同表单控件上传多个文件
[uploader]="uploader" formControlName="imageUpload" multiple />
<td nowrap>
<button type="button" class="btn btn-success btn-xs
(click)="item.upload()" [disabled]="item.isReady || item.isUploading || item.isSuccess">
<span ></span> Upload </button>
<button type="button"s"
(click)="uploader.uploadAll()" [disabled]="!uploader.getNotUploadedItems().length">
<span></span> Upload all</button>
```
component.ts
```public uploader:FileUploader = new FileUploader({url: URL,authToken:`Bearer ${this.Token}` });
public hasBaseDropZoneOver:boolean = false;
public hasAnotherDropZoneOver:boolean = false;
public fileOverBase(e:any):void {
this.hasBaseDropZoneOver = e;
}
public fileOverAnother(e:any):void {
this.hasAnotherDropZoneOver = e;
}```
解决方案
推荐阅读
- apache - 让我们使用 NGINX + Apache Docker swarm NET::ERR_CERT_INVALID 加密 SSL
- javascript - 如何获取vue js中所有列的总和
- python - df.isna().sum() 不适用于泰坦尼克数据集
- swift - Swift/URLSession 返回与 OpenSSL 不同的公钥
- twilio - 创建会议后立即拨打号码
- java - 数组快捷语法困境 | Java 编程语言
- node.js - 如何在 Typescript 中正确扩展 Request 的标头
- axapta - 如何在 d365 中动态更改 formcommandbuttonControl 的命令?
- python - 类型错误:“功能”缺少一个必需的位置参数:“自我”
- python - 使用 map() 的 multiprocessing.Pool 在大列表输入时表现得非常慢