I have a file <input />
and a <button>
, with a click handler assigned to the button.
What I would like to do is to execute the click handler on the submit button when the selected file changes on the file input.
My code currently looks like this:
angular.module('myapp', [])
.controller('MyController', function($scope) {
$scope.clickMe= function(){
alert("File Submitted!");
}
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app="myapp">
<div ng-controller="MyController">
<input type = "file">
<div><button ng-click="clickMe()">Submit</button></div>
</div>
</body>