How do I get the response object after I send a Restangular POST?
firstAccount.post("Buildings", myBuilding).then(function() {
console.log("Object saved OK");
}, function() {
console.log("There was an error saving");
});
I'm trying to get the new object id.
Thanks.
I'm the creator of Restangular. Flim is right :).
In the promise then you get the object returned from the server :)
firstAccount.post("Buildings", myBuilding).then(function(addedBuilding) {
console.log("id", addedBuilding.id);
}, function() {
console.log("There was an error saving");
});
Thanks!