Java 使用AngularJs上传文件创建指令
我想为读取输入类型=文件创建一个my指令,但我在这个问题上失败了。我以以下方式在html页面中编写我的代码:Java 使用AngularJs上传文件创建指令,java,javascript,jquery,ajax,angularjs,Java,Javascript,Jquery,Ajax,Angularjs,我想为读取输入类型=文件创建一个my指令,但我在这个问题上失败了。我以以下方式在html页面中编写我的代码: <body ng-controller="insertController"> <div> <input type="file" file-model="myFile"/> </div> <div> {{message}} </div> </bod
<body ng-controller="insertController">
<div>
<input type="file" file-model="myFile"/>
</div>
<div>
{{message}}
</div>
</body>
modulo.directive('fileModel', function() {
return {
restrict: 'AEC',
templateUrl: 'insert.html',
link: function(scope, element, attrs) {
scope.message = attrs.fileModel;
}
};
});
此外,我读了我的控制器,但它是空的
modulo.controller('insertController', function($scope, $http) {
});
我怎样才能解决这个问题?谢谢 您可以使用此线程中的一个解决方案。