Open moparlakci opened 4 years ago
Just to let you know if you wrap your ng-file-upload with an ng-if it will create a child scope and the ng-model binding will not work.
ng-if
ng-model
It will work but it will only change the model in the child scope and the 'parent' the actual scope will not know about it.
Use ng-show instead..
ng-show
$scope.files = null;
<div ng-if="isReady"> <label>Choose file</label> <input type="file" ngf-select ng-model="files" ngf-multiple="true" ngf-pattern="'*/*'" ngf-accept="'*/*'" ngf-max-size="20MB" /> </div>
console.log($scope.files); null
<div ng-show="isReady"> <label>Choose file</label> <input type="file" ngf-select ng-model="files" ngf-multiple="true" ngf-pattern="'*/*'" ngf-accept="'*/*'" ngf-max-size="20MB" /> </div>
console.log($scope.files); [{}, {}, {}}]
Just to let you know if you wrap your ng-file-upload with an
ng-if
it will create a child scope and theng-model
binding will not work.It will work but it will only change the model in the child scope and the 'parent' the actual scope will not know about it.
Use
ng-show
instead..$scope.files = null;