You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have code that attempts to use the ng-file-rejected-model attribute along with ng-file-drop.
There are two minor issues I have with this item:
It is mis-documented as ng-rejected-file-model on your API page, but not a huge deal since I can read the code
It doesn't work with the ng-file-select, so I still need special code to handle other rejections (understandably given implementation limitations on those controls, if my perception of that is correct with HTML5).
My main concern, however, is that I can't seem to put a watch on the variable. I only get the event once if I try, ie:
<div class="btn btn-primary form-control" ng-file-drop allowDir="false" ng-model="myFiles"
ng-show="dropSupported" drag-over-class="documents-dragover"
accept="application/xml,text/xml" ng-file-rejected-model="myRejFiles">
Click here or drag a file over to upload</div>
...
$scope.$watch('myRejFiles', function() {
if (angular.isArray($scope.myRejFiles)) {
$scope.myRejFiles.forEach(function(file) {
showRejected(file);
});
}
});
This code will only allow my showRejected function to be called on the first drag and drop of an invalid file.
I thought I could instead rely only on the myFiles watch, at which time I could see if myRejFiles is also set, but in that case, myRejFiles will only contain the first item(s) from the initial failed drag and drop, and will send that even if there are no rejects this time around.
Maybe I am using this wrong, or maybe there is an issue of some sort? Sorry, I have not yet been able to spend time to debug it much further.
The text was updated successfully, but these errors were encountered:
I have code that attempts to use the ng-file-rejected-model attribute along with ng-file-drop.
There are two minor issues I have with this item:
My main concern, however, is that I can't seem to put a watch on the variable. I only get the event once if I try, ie:
This code will only allow my showRejected function to be called on the first drag and drop of an invalid file.
I thought I could instead rely only on the myFiles watch, at which time I could see if myRejFiles is also set, but in that case, myRejFiles will only contain the first item(s) from the initial failed drag and drop, and will send that even if there are no rejects this time around.
Maybe I am using this wrong, or maybe there is an issue of some sort? Sorry, I have not yet been able to spend time to debug it much further.
The text was updated successfully, but these errors were encountered: