Created
March 4, 2016 20:25
-
-
Save ray-peters/565ded3338e8e399cda8 to your computer and use it in GitHub Desktop.
Fix for ng-file-upload - Create and segment invalids via an error blacklist. Do not mark files invalid because of maxLength.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function separateInvalids() { | |
var skipErrors = [ "maxFiles" ]; | |
valids = []; | |
invalids = []; | |
angular.forEach(allNewFiles, function (file) { | |
if (file.$error) { | |
if ( skipErrors.indexOf( file.$error ) !== -1 ) return; | |
invalids.push(file); | |
} else { | |
valids.push(file); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment