Multiple instances - NG file upload Danial Farid ver 10

35 views Asked by At

I've looked at questions posted under this first tag but I could not find anything that matches what I am trying to do.

Is there a way to create multiple instances of the uploader in the same page?

I have this chunk that has been working well

<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>

Then I added this piece couple of lines below

<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>

even though the function fires on the second one, the model object is empty. It does not show the selected files

I'd really appreciate some help, thank you

1

There are 1 answers

0
ODelibalta On

Sorry about the post. My code was not working because the second one was under an if render which was false at the beginning. I know the issue now, ty