zefoy / ngx-dropzone-wrapper

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

filremoved not getting fired. #16

Closed gdevdeiv closed 7 years ago

gdevdeiv commented 7 years ago

Hi there,

I have been using this module for a while, and I just wanted to add the "Remove file" option, so my code looks like this right now:

submit.component.ts

...

dropzoneSettings = {
    server: 'https://example.com/upload',
    maxFilesize: 20,
    acceptedFiles: 'image/*',
    addRemoveLinks: true
};

...

onFileRemoved(event: any) {
    console.log("Removed.");
    console.log(event);
}

...

submit.html

...

<dropzone [config]="dropzoneSettings" [message]="'Drag here.'" (error)="onUploadError($event)" (success)="onUploadSuccess($event)" (removedfile)="onFileRemoved($event)" id="dropzonePreview"></dropzone>

...

The thing is that the onFileRemoved() function is not getting called. Am I missing something?

sconix commented 7 years ago

Everything looks correct, I can quickly check that why its not working later this week.

gdevdeiv commented 7 years ago

Also, I've noticed (error) and (success) events are not getting fired either. The thing is that (uploadError) and (uploadSuccess) do. Any relation to the aforementioned issue?

sconix commented 7 years ago

Then you are using an old version. Latest version does not have upload* events anymore only the events named according to Dropzone's own events.

I bumbed up the version to 2.x when I added AOT since there was a change that it brakes some build configurations so if you are using ^1.x in your package.json its not enough to get the latest version.