Angular Directive: trigger a change for input[type="file"].
- Add 'ngFileTriggerChange' to your modules;
- Add the Directive 'ng-file-trigger-change' to your html code;
- You're ready.
<input type="file" ng-model="vm.files" ng-change="vm.fileChanged()" ng-file-trigger-change accept="image/*" capture multiple />
vm.files = null; vm.changed = function() { window.console.log( vm.files ); // Output --> The FileList };