Closed
Description
I have a form which, in addition to uploading a file, sends some other fields. For clarity, I send only one field in this example:
$scope.save_with_upload = function(user) {
$scope.uploader.formData = [{
name: user.name,
}];
$scope.uploader.uploadAll();
}
Let’s say the value of the name
input is Test 1.
- When I first load the page and click Save, it sends the file but doesn’t send
formData
at all. - Then I change
name
field to Test 2 and hit Save. It sends the file andformData
, but the value ofname
it sends is Test 1. - Then I change
name
field to Test 3 and hit Save. It sends the file andformData
, but the value ofname
it sends is Test 2. - … and so on …
So it seems to always send the data that was assigned to formData
before the last call to uploadAll
.
To clarify: If I do dir(user, $scope.uploader.formData)
just before calling uploadAll
, it shows correct up-to-date values in both.
I’ve been struggling with it for a few hours and just can’t seem to see what’s wrong. Any ideas?
Metadata
Metadata
Assignees
Labels
No labels