I am newbie to angularJS
. I want to submit a form with angularjs.
I am using the following code :
var app = angular.module('zippyModule', []);
app.controller('Ctrl3', function($scope, $http, $location,$compile) {
$scope.submit = function(){
alert($scope.filename);
}
});
and in form I am using :
<div ng-show="show">
<form ng-submit="submit()" enctype="multipart/form-data">
<input type="file" ng-model="filename" name="filename" />
<br/>
<input type="submit" class="btn btn-primary" name="upload" value="Upload">
</form>
</div>
When I am submitting the form then it is alerting undefined
. How can I print the value of the file field after submitting the form ?