-
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
ngf-change gets called as soon as button is clicked #762
Comments
You are right though I wont say it's an error. I believe if your model did not specify null initially then a 'change' would have been detected. For now, you can do an if (file && file.length) |
Updated the wordings in the doc. |
Please re-open. This can't possibly be the intended behavior. Not only does it fire before the file chooser opens, but also after. |
Yea I explained it in the docs, it will be called when the files selected or cleared by clicking on the button. |
@danialfarid What I'm seeing is that I added this to your fiddle...
Whatever is calling it shouldn't call it the first time. There is no reason to call $scope.upload if files is null. This would allow me to remove the null check and simplify things greatly. |
I explained on my first comment why it needs to be set to null when you click on it. So it is expected behaviour. |
It doesn't need to fire. |
The documentation suggests that
ngf-change
would be called after the files are selected in the chooser dialog. Right now, it gets called as soon as the button is clicked.The text was updated successfully, but these errors were encountered: