I wrote the following directive for watch input type="file":
app.directive("fileRead", [function () {
return {
link: function (scope, element, attributes) {
element.bind("change", function (changeEvent) {
console.log("change")
scope.$apply(function () {
scope.iptImg = element.val()
});
});
}
}
}]);
$scope.$watch("iptImg",function(newValue,oldValue){
console.log("file path"+newValue)
console.log("the other code")
})
It works on Chrome, but it doesn't work on IE10, is there a way to make it run on IE10?