3
我試圖讓blueimp文件上傳插件與我的應用程序很好地玩,使用angularjs。我有一個問題。我的服務器在成功上傳時返回json數據。問題是我無法檢索這些數據,儘管我可以在控制檯中找到它。使用angularjs blueimp fileupload獲取服務器響應數據?
$scope.$on('fileuploadprocessdone', function(event, files){
console.log(files);
});
控制檯:
Object {disabled: false, create: null, dropZone: x.fn.x.init[1], pasteZone: x.fn.x.init[1], replaceFileInput: true…}
_progress: Object
_response: Object
jqXHR: Object
result: Object
textStatus: "success"
我試圖讓在 「_response」 對象中的 「結果」 對象:
$scope.$on('fileuploadprocessdone', function(event, files){
console.log(files._response);
console.log(files.response);
});
回報(控制檯):
Object {} //first console log
function() {
return this._response; //second console log
}
我可以清楚地看到serv返回的數據呃在第一個console.log(文件)。我怎樣才能做到這一點?
謝謝。