ngf-select function called with null
See original GitHub issueHi,
I think there is a problem with the function ngf-select="uploadFile($file)"
following these steps:
- Click to select a file
- Click to select another file
When clicking the second time, the function uploadFile
is called with $file = null.
Fiddle of the issue https://jsfiddle.net/kikar/25qnends/
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
When I select button using ngf-select, ng-model is changed to ...
when i click ptgui-imagebox showing image, ng-model is changed. but I want to maintain image before I select new image. How can I...
Read more >48 answers on StackOverflow to the most popular Angular ...
How can I get new selection in “select” in Angular 2? Angular exception: Can't bind to 'ngForIn' since it isn't a known native...
Read more >Success with ng-file-upload and xdomain - Plunker
querySelectorAll("input,select")).filter(function (e) { var _ref; ... getResponseHeader = function (header) { var name; name = header != null ? header.
Read more >Upload File using Angular.JS and Node.JS | by Hensle Joseph
cb(null, file.fieldname + '-' + datetimestamp + '. ... are displaying the thumbnail of the file selected using the ngf-thumbnail directive.
Read more >angularjs – Adeel's Corner
Then the ngf-select directive can be used to define a function which is called AFTER the resizing is complete, and this is where...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You might already know but you can get the rejected files by ngf-model-invalid or ngf-select=“select($invalidFiles, $files)”. The files that won’t pass the validation won’t be set to model or $files.
I tried this issue’s fiddle and it works different to my application. This fiddle (ng-file-upload version 11.2.3) returns file, null and then file again. In my application (ng-file-upload version 7.3.9) it just return file and then null. The last file never comes.
Now I understand why you say it works. By design clients must allow nulls to be received when these cases happen (for example, when the button is clicked a second time or errors). I can’t upgrade right now so I will have to implement a workaround. Thanks!