Use response.status
to get return code when failed and use response.plain()
or Restangular.stripRestangular(response)
to get return clean data without any Restangular methods. Pay attention that the .plain()
attribution is supported after 1.4.0 version of Restangular. Here comes the example:
Restangular.all(xxx).post(cmd).then(function(response) {
//console.log(response.plain()); //plain
//Restangular.stripRestangular(response); //stripRestangular
}, function(response) {
console.log("Error with status code", response.status);
});