Darama Darama - 4 years ago 117
AngularJS Question

How to enable button Angular JS if file was selected?

I use this library for uploading files in Angular JS.

How can I enable submit button if file was selected?

I can get access to object:

var uploader = new FileUploader({})

Answer Source

Just check the length of queue property - this is an array with selected file(s).


$scope.uploader = new FileUploader({});


<button type="button" ng-disabled="uploader.queue.length < 1">Upload</button>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download