I am creating a web application in which I have an input field
<input type="file" ng-model="getfilename" />
and button
<button ng-click="clickfordetails()">Click Here!</button>
and the paragraph tag <P>{{file}}</p>
when the user presses the button after entering the file from the input field, he should get the file name in{{file}}
and here is my controller for the same
$scope.clickfordetails=function() {
$scope.file=$scope.getfilename;
}
but I canโt get the file name when I edit my controller on this
$scope.clickfordetails=function() {
console.log($scope.getfilename);
}
the value in my console (google chrome) is Undefined
how do i need it?
source
share