title: Angular, how to correctly map REST Objects
body: <p>I'm very new at angular and am having a little trouble mapping objects from the rest calls via a service i created.</p>
  
  <p>I have a service</p>
  
  <pre><code>var teacherServices = angular.module('teacherServices', ['ngResource']);
  
  teacherServices.factory('Items', ['$resource',
  function($resource) {
      return $resource('/class/item/:class_id', {Id: "@Id"}, {
          query: {method:'GET', params:{class_id:''}, isArray:false}
      });
  }]);
  </code></pre>
  
  <p>And i am attempting to get a list of the objects using</p>
  
  <pre><code>teacher_app.controller('ItemsCtrl', ['$scope', '$route', 'Items', function($scope, $route, Items) {
  Items.get({class_id : $route.current.params.classId}, function(response) {
      $scope.items = response.items;
      $scope.items[0].$save();  //Does not exist
  });
  </code></pre>
  
  <p>}]);</p>
  
  <p>I have two questions</p>
  
  <p>1) How would I correctly map the objects so that it has all the default functions like $save()</p>
  
  <p>2) How would I create my custom functions for the objects</p>
  
  <p>Thank you</p>