Javascript Ng文件上传未定义?
我上传文件时遇到问题。所以,我有:Javascript Ng文件上传未定义?,javascript,angularjs,Javascript,Angularjs,我上传文件时遇到问题。所以,我有: <button type="button" class="btn btn-success btn-lg" ng-click="send()" ng-if="data.try"> <span class="glyphicon glyphicon glyphicon-send"></span> Send </button> 剩下的代码sendMailJava是下一个代码,它将整个文档和信息发送到JAVA 当
<button type="button" class="btn btn-success btn-lg" ng-click="send()" ng-if="data.try">
<span class="glyphicon glyphicon glyphicon-send"></span> Send
</button>
剩下的代码sendMailJava是下一个代码,它将整个文档和信息发送到JAVA
当我尝试console.log这个文件时,我没有定义。我真的不知道发生了什么事。另外,看看那里:。我已经用这个例子编写了1:1的代码,但仍然一无所获。只是没有定义。此外,我还更改了JSFIDLE(按钮替换为输入类型文件)上的代码。我已经用这个例子编写了1:1的代码,但仍然一无所获。只是没有定义。此外,我还更改了JSFIDLE(按钮替换为输入类型文件)上的代码。
<input type="file" ngf-select="uploadFiles($file, $invalidFiles)"/>
$scope.send = function(){
$scope.uploadFiles = function(file, errFiles) {
$scope.f = file;
$scope.errFile = errFiles && errFiles[0];
if (file) {
file.upload = Upload.upload({
url: 'static/css',
data: {file: file}
});
file.upload.then(function (response) {
$timeout(function () {
file.result = response.data;
});
}, function (response) {
if (response.status > 0)
$scope.errorMsg = response.status + ': ' + response.data;
});
}
console.log("ASDASD1111111111");
console.log($scope.f);
}
$scope.data.try = false ;
$scope.sendMailJava();
}