How to combine my two $http.post into single http post?
$scope.myMethod = function(){
var fd = new FormData();
angular.forEach($scope.files, function(file){
fd.append('file', file);
});
$http.post('my_url', fd, {
transformRequest: angular.identity,
headers: {'Content-Type': undefined}
}).success(function(result){
console.log(result);
});
$http.post('my_url', {imgx: $scope.imgx, imgy: $scope.imgy, imgh: $scope.imgh, imgw: $scope.imgw}).success(
function(data){
console.log(data);
});
}
any help is very appreciated, Thank you