I have the following problem in Angular JS. I have this loop:
angular.forEach(objects, function(object)
{
UpdateFactory.updateObjectInDatabase(version, object).then(function(newVersion)
{
version = newVersion;
alert("Update successful! Version number increased.);
});
});
But my problem is: I want only to call the Factory method, if previous call is finished. Otherwise I get status code 409, because of the wrong version.
I would be pleased if someone could help me!
Best regards.