danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.6k forks source link

How To clear rejectedFiles on new file upload #2068

Open ethanmac opened 6 years ago

ethanmac commented 6 years ago

Hi all I am currently showing a list of errors on screen and then hiding after a few seconds.I have ngf-model-invalid="errorFiles and I set $scope.errorFiles = []; when finished displaying the errors.However when I upload a new set of files and the validation for one or more fails the new errors PLUS the old errors are being shown even after I had cleared down $scope.errorFiles the values seem to persist.Anyway I can clear down the model used in ngf-model-invalid="errorFiles".

$scope.$watch('errorFiles', function (errorFiles) {
    $scope.showAlert = true;
    $scope.alerts = errorFiles;
    $scope.alert.type = "alert alert-danger text-center";

    $timeout(function () {
        $scope.showAlert = false;
        $scope.errorFiles = [];

    }, 4000);
});
axul commented 5 years ago
leikoilja commented 4 years ago

Confirm that the bug still exits :cry: