title: Angular $resource - attach a generic .finally function to a method
body: <p>I have a generic restful resource with angular's $resource.  On any save method, I also want to set a message and boolean on whatever scope I'm in, and set a timeout for that message.  So anywhere in my code where I call .save/.$save, I then attach a .finally onto it (below).</p>
  
  <p>Rather than putting the same .finally onto every save I call, I'm wondering if I can just write a finally onto the actual resource itself, and have this be a generic finally for my save function.  </p>
  
  <hr>
  
  <pre><code>var resource = $resource(
    pageListPath, 
    {}, 
    {
      query: {method:'GET', isArray:true},
      get: {method:'GET', url: pageDetailPath, params:{id:'@id'}, cache:true},
      save: {method:'PUT', url: pageSavePath, params:{id:'@id'}},
      delete: {method:'DELETE', url: pageDetailPath, params:{id:'@id'}}
    }
  );
  
  return resource;
  </code></pre>
  
  <hr>
  
  <pre><code>    .finally(function() {
        $scope.loading = false;
        $timeout(function() {
          $scope.message = false;
        }, 2500);
      });
  </code></pre>
  
  <hr>
  
  <p>Ideally something like </p>
  
  <pre><code>save: {
    method:'PUT', 
    url:pageSavePath, 
    params:{id:'@id'}, 
    finally:function() { doStuff() }}
  </code></pre>
  
  <p>is what I'm looking for.  Is this possible?</p>