wKoza / ngx-upload

Ngx-upload is an upload module for Angular Ivy ready
30 stars 15 forks source link

Possibility of (fileSelected) event on ngxDragAndDrop #87

Open mrklika opened 3 years ago

mrklika commented 3 years ago

Hi, is there any possibility of adding some helper outputs like fileSelected on ngxDragAndDrop?

Assume that I have one form with 2 instances of fileSelect:

       <div
        class="my-drop-zone"
        ngxDragAndDrop
        *ngxInputFile>
        <span class="__drop-text">Click to select...</span>
      </div>
       <div
        class="my-drop-zone"
        ngxDragAndDrop
        *ngxInputFile>
        <span class="__drop-text">Click to select...</span>
      </div>

and I want to store my files in the file queue by keys like:

coverImage: [ FILE ]

gallery: [ FILE, FILE, FILE ]

only available available this._uploader.onAddToQueue$ listens to queue without the option to focus on a single file drop or select.

Would be great to have something like:

       <div
        class="my-drop-zone"
        ngxDragAndDrop
        *ngxInputFile
       (fileSelected)="addToQueue({ key: 'coverImage', file: $event })">
        <span class="__drop-text">Click to select...</span>
      </div>
wKoza commented 3 years ago

Hi @mrklika, Seems interesting. I'll try to do that the next week.