Retrieving data out of post success from separate controller angularjs
问题 I am writing a simple service that uploads a file and posts it to a Spring controller. The controller manipulates this data and returns several objects as JSON. I am working with the following Angular service: myApp.service('fileUpload', [ '$http', function($http) { this.uploadFileToUrl = function(file, uploadUrl) { var fd = new FormData(); fd.append('file', file); $http.post(uploadUrl, fd, { transformRequest : angular.identity, headers : { 'Content-Type' : undefined } }) .success(function