title: AngularJS transformResponse
body: <p>In angularjs resource, I would like to convert my json data into JS objects</p>
  
  <pre>
  //Complex object with inheritance chain
  function Car(year, make){
      this.make = make;
      this.year = year;
  }
  
  
  var carResource = $resource("/api/car/id", {id: '@id'},
      {
          get: {
              method: 'GET',
              transformResponse: function(data, headersGetter){
                  return new Car(data.make, data.year);
              }
          }
      }
  )
  </pre>
  
  <p>However this does not seem to be happening</p>
  
  <p>What I am getting back is a <code>$resource</code> object meaning that the properties <code>make</code> and <code>year</code> are set correctly, however the prototype of the returned object points to <code>$resource</code></p>
  
  <p>Is there a way where I can map my json data directly to my own objects?</p>
  
  <p>Or will I have to write my own 'resource' implementation?</p>