Angularjs 角度-如何在IE中获取文件
我无法从IE9/8上的输入文件中获取文件。10件作品Angularjs 角度-如何在IE中获取文件,angularjs,file,internet-explorer,Angularjs,File,Internet Explorer,我无法从IE9/8上的输入文件中获取文件。10件作品 <input type="file" file-model="onFileSelected($files)" /> app.directive('fileModel', ['$parse', function ($parse) { return { restrict: 'A', link: function(scope, element, attrs) {
<input type="file" file-model="onFileSelected($files)" />
app.directive('fileModel', ['$parse', function ($parse) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
var fn = $parse(attrs["fileModel"]);
element.on('change', function(e) {
console.log(e.target.files);
})
}
};
}]);
app.directive('fileModel',['$parse',function($parse){
返回{
限制:“A”,
链接:函数(作用域、元素、属性){
var fn=$parse(attrs[“fileModel”]);
元素。on('change',函数(e){
console.log(e.target.files);
})
}
};
}]);
e、 target.files在IE9上未定义此问题已得到回答,并且已被删除 不过,我可以推荐你看看。如果您需要一次上载多个文件,它会使用flash shim为大多数浏览器处理文件输入的抽象。可能的重复项: