Open krptodr opened 6 years ago
I have a directive, that I am calling Upload.upload on. My directive template is specifying that ngf-model-invalid="invalidFiles" here is my example:
scope.invalidFiles = []; scope.invalidFile=null; scope.$watch('invalidFile', function(invalidFile){ if (invalidFile) scope.invalidFiles.push(invalidFile); });
<div ngf-drop="selectFile(picFile)" ngf-model-invalid="invalidFile" ngf-select="selectFile(picFile)" type="file" ngf-multiple="false" ng-model="picFile" name="file" ng-attr-ngf-pattern="{{form.schema.pattern && form.schema.pattern.mimeType ? form.schema.pattern.mimeType : undefined }}" ng-attr-ngf-max-size="{{form.schema.maxSize && form.schema.maxSize.maximum ? form.schema.maxSize.maximum : undefined }}" ng-required="form.required" accept="{{form.schema.pattern && form.schema.pattern.mimeType}}" ng-model-options="form.ngModelOptions && { allowInvalid: true, debounce: 1000}" ngf-drag-over-class="dragover" class="drop-box dragAndDropDescription"> </div>
However, upon line L559 below, the scope contains the invalidFile, but my scope.$watch('invalidFile') is never called.
https://github.com/danialfarid/ng-file-upload/blob/d911c553d0c1be76276a3b50ad5e3e8345c91747/dist/ng-file-upload.js#L556-L561
if I were to run ng-file-upload directly from my controller, then my $scope.$watches work fine.
Any idea for a solution?
I have a directive, that I am calling Upload.upload on. My directive template is specifying that ngf-model-invalid="invalidFiles" here is my example:
However, upon line L559 below, the scope contains the invalidFile, but my scope.$watch('invalidFile') is never called.
https://github.com/danialfarid/ng-file-upload/blob/d911c553d0c1be76276a3b50ad5e3e8345c91747/dist/ng-file-upload.js#L556-L561
if I were to run ng-file-upload directly from my controller, then my $scope.$watches work fine.
Any idea for a solution?