I'm very new at angularjs and I'm in trouble,
I have html like this:
<section class="content" ng-app="offer">
<div ng-controller="OfferController">
...
<input name="Attachment" type="file" class="file_up" onchange="angular.element(this).scope().change(this)" ng-model="Attachment" />
<span>{{Attachment}}</span> //i can't get it
...
</div>
</section>
and script:
var myApp = angular.module('offer', []);
myApp.controller('OfferController', ['$scope', function ($scope) {
$scope.change = function (element) {
if (element.files.length > 0) {
$scope.Attachment = element.files[0].name;
}
else {
$scope.Attachment = "";
}
console.log($scope.Attachment); // I can get changed value in console
}
}]);
image:
I can get changed value in console but I can't get in html side when input's value change. Thank you so much in advance for any help.