I'm Uploading files with AngularJS. How to get the input files just like regular JS?
This is what I need to simulate exactly
HTML:
<input type="file" name="file" id="fileImg" accept="image/*">
JS:
var filesUpload = document.getElementById("fileImg").files
This is what I have now
HTML:
<input type="file" name="file" ng-model="image" accept="image/*">
<input type="button" ng-click="submit()" value="press me">
Angular:
angular
.module('app')
.controller("productsCtrl", function($scope) {
$scope.image = {};
$scope.submit = function() {
var filesUpload = ????????????????
}
}
So, how to get the "files" in the input withput using "getElementById" ?
notice - can't change nothing , only the "??????"
any help will be appreciated..
tnx