title: How do you add a callback to an angular resource?
body: <p>I have a view showing a list of items:</p>
  
  <pre><code>&lt;li ng-repeat="item in items"&gt;{{item.name}}&lt;/li&gt; 
  </code></pre>
  
  <p>The service associated with this is:</p>
  
  <pre><code>angular.module('itemService', ['ngResource']).
      factory('Item', function($resource){
          return $resource('/api/v1/item/:itemId', {}, {
              query:   {method:'GET',  params:{itemId : ''},          isArray : true},
              get:     {method:'GET',  params:{itemId : ''},          isArray : false},
              save:    {method:'POST', params:{itemId : ''},          isArray : false},
              update:  {method:'PUT',  params:{itemId : '@_id.$oid'}, isArray : false}
          });
      });
  </code></pre>
  
  <p>finally I use query when the controller is initialied to load the list of items.</p>
  
  <pre><code>function ItemCtrl($scope, Item) {
  
      $scope.items  = Item.query();
      ....
  </code></pre>
  
  <p>On the same page I can create new items and call <code>save()</code> to save them to the server. But when I do this I would like to update the view to show the new item instead of reloading the whole list with <code>query()</code>. Since the view is the official record I assume that after successfully saving the item I should push it to the end of items. This should be done after <code>save()</code> completes so I would like to know how to add/specify a callback to the save function.</p>
  
  <p>EDIT: <code>save()</code> returns a copy of the saved item (if successful) so I can ensure that the item was saved successfully on the server.</p>