zefoy / ngx-dropzone-wrapper

Angular wrapper library for Dropzone
MIT License
174 stars 51 forks source link

How to listen remove file event? #105

Closed huuquyasb closed 6 years ago

huuquyasb commented 6 years ago

My code upload.component.html <dropzone [config]="config" (canceled)="cancelUpload($event)" (removedfile)="onFileRemoved($event)" [message]="'Click or drag images here to upload'" (error)="onUploadError($event)" (success)="onUploadSuccess($event)"></dropzone>

upload.component.ts onFileRemoved(event: any) { console.log('Removed.'); console.log(event); } Remove button version 6.1.0

huuquyasb commented 6 years ago

I found it. init: function() { const dz = this; dz.on('removedfile', function (file) { console.log('file remove', file); }); } Thanks dropzone 👍 🥇

sconix commented 6 years ago

The output name is removedFile not removedfile if you want to use the Angular events.

MooNLightSur commented 1 year ago

In my case, the (removedfile) is called after form submit also