danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.59k forks source link

file still exists in ngf after it has been deleted #1975

Closed ryanhinton closed 7 years ago

ryanhinton commented 7 years ago

Hello,

I am experiencing what seems to be an identical issue as from this past Issue in 2015.

https://github.com/danialfarid/ng-file-upload/issues/971

I'm troubleshooting to figure out why. I have an option for the user to delete a file that has yet to be uploaded and saved to the server. I use the ngf-selected attribute that calls a function and if a user decides to add another file, the deleted file comes back with the newly selected file. Meaning, the $files array passed in is still holding the deleted file for some reason.

ryanhinton commented 7 years ago

I was able to resolve this issue using the following code:

ngf-model-options="{updateOn: 'change click drop dropUrl paste', allowInvalid: false, debounce: 0}"