Skip to content

Commit

Permalink
Added ability to allow functions supplied to ngfModelInvalid.
Browse files Browse the repository at this point in the history
  • Loading branch information
krptodr committed Nov 23, 2017
1 parent d911c55 commit 5ddde2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ ngFileUpload.service('Upload', ['$parse', '$timeout', '$compile', '$q', 'UploadE
var invalidModel = upload.attrGetter('ngfModelInvalid', attr);
if (invalidModel) {
$timeout(function () {
$parse(invalidModel).assign(scope, isSingleModel ? invalidFile : invalidFiles);
if (invalidModel.includes('(')){
$parse(invalidModel)(scope, {$invalidFile: invalidFile, $invalidFiles: invalidFiles});
} else {
$parse(invalidModel).assign(scope, isSingleModel ? invalidFile : invalidFiles);
}
});
}
$timeout(function () {
Expand Down

0 comments on commit 5ddde2d

Please sign in to comment.