-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate only last files when ngf-keep="true #1007
Comments
I updated ng-file-upload to recent version the problem seems to be fixed. Issue to close. |
This issue is still exist as I'm using 12.0.1 |
When you set the ng-model value it will replace everything including the invalid files, so if you want it to persist the invalid files, add them to the ng-model variable before setting it. |
I'm sorry but I didn't get you. I added "ngf-keep" to keep the files I have been already chosen but when I add an invalid file it validates as should be but if I added a valid file again it doesn’t validate as it should be. |
Hi @danialfarid There are couple of bugs I have found while testing. Will post them soon. Thanks |
"Me too". Assume I have: ...if I try to select 6 files, the validation kicks in and works. The issue is, when I click the button again to reselect 5 or less files, the validation hasn't been cleared -- still invalid. If I set ngf-keep="false", everything works as expected; the problem is, this behaviour is undesirable in my case. (Version 12.0.1) Chris |
@jar240 you need to reset the ng-model to empty if you want to remove those files. Removing them from ngf-invalid-model will not trigger any validation, you need to set the ng-model to empty array or whatever files are left there. |
@danialfarid an example would be stellar. The timing isn't clear to me... In my mind, this should be taken care of by ng-file-upload when the upload button is clicked a second (third, fourth, etc. time). Otherwise how would I implement this in a sensible way? Thanks, |
@danialfarid is it possible to handle all valid and invalid files in a single model with a flag We could also implement remove method inside the directive so then it will be easy to change valid/invalid states in the model. |
@madurapa It is already attached to each file, just set |
I've missed that option, It makes life easier ;) |
fixed at version 12.0.3 |
When
ngf-select
ngf-keep="true"
ngf-multiple="true"
(andngf-max-size="3MB"
with upload on submit) and I add invalid file/files (maxSize exceeded in my case) files model is invalid (correctrly), but if next I add a valid file/files, then files model is valid (incorrectly). This seems to be incorrect, beceause in files model still is invalid file/files waiting to upload.The text was updated successfully, but these errors were encountered: