title: AngularJS - handling RESTful $resource response
body: <p>I have an restful api and angularjs app.
  I am using $resource inside a factory to work with this api.
  I have a problem with one request. I POST my api to create some elements.</p>
  
  <pre><code>/api/service/thing/make-things
  </code></pre>
  
  <p>I need to pass in my request some data. Here is what I am doing:</p>
  
  <pre><code>$scope.someRequest = new SomeRequest(); // factory object returning an $resource
  $scope.someRequest.some_field = 'abc';
  $scope.someRequest.$save({someAdditionalParams:'123'}, function(values){...handling response...});
  </code></pre>
  
  <p>It works fine and POSTs data I want to post, but in this particular case my post response is array of objects.</p>
  
  <pre><code>[{somestuff:'123'}, {somestuff:'321'} ... ]
  </code></pre>
  
  <p>Angular tries to map it back to an object and throws me an error that object was expected but got an array. I tried to create a separate resource method with isArray:1, but it still failed with same kind of error.</p>
  
  <p>So, my question is: how to handle this situation? Is it possible to cancel copying $save result to $resource object?</p>