【发布时间】:2021-11-19 21:34:09
【问题描述】:
我查看了在第一个标签下发布的问题,但找不到与我正在尝试做的事情相匹配的任何内容。
有没有办法在同一个页面中创建多个上传器实例?
我有这个一直运行良好的块
<div
class="btn btn-success btn-lg btn-outline offset-sm-2 col-sm-8" id="fileSelectButton" name="fileUpload"
ng-show="canSelect && !isProcessing && fileReaderSupported && !partialFiles.length"
ng-id="odsFileSelect" tabindex="0"
ngf-accept="selectedUploadType.expected_file_type"
ng-model="selectedFiles" ngf-keep="'distinct'"
ngf-select="setBannerStatus('isProcessing'); onFileSelect(selectedFiles); "
ngf-multiple="true"
>
Click to upload {{ selectedUploadType.display_name }} files
</div>
然后我在下面添加了这几行
<div
class="btn btn-success btn-lg btn-outline offset-sm-2 col-sm-8"
id="partialSelectButton" name="partialUpload"
ng-show="canSelect && !isProcessing && fileReaderSupported"
ng-id="odsPartialSelect" tabindex="0"
ngf-accept="selectedUploadType.expected_file_type"
ng-model="partialFiles" ngf-keep="'distinct'"
ngf-select="onPartialSelect(partialFiles); "
ngf-multiple="true"
>
Click to add or replace files
</div>
即使函数在第二个函数上触发,模型对象也是空的。它不显示选定的文件
非常感谢您的帮助,谢谢
【问题讨论】:
标签: javascript angularjs file-upload ng-file-upload