title: How to set request body and params on $resource POST
body: <p>I'm attempting to pass data in the request body and a request parameter to an Angular $resource call. Below is my click handler from my controller and the service which it calls:</p>
  
  <p>controller.js:</p>
  
  <pre><code>vm.setLimit = function(limit) {
    var data = {
      activity: 'point_limit',
      limit: limit
    };
    playersService.setPlayerLimit({
      playerId: playerId,
      data
    });
  };
  </code></pre>
  
  <p>service.js:</p>
  
  <pre><code>angular.module('gameApp')
    .factory('playersService', ['$resource',
      function($resource) {
        var base = '/api/players/:playerId/';
        return $resource(base, {}, {
          getPlayerInfo: {method: 'GET', url: base + 'playerInfo'},
          setPlayerLimit: {method: 'POST', url: base + 'playerLimit'}
        });
      }]);
  </code></pre>
  
  <p><code>getPlayerInfo</code> works, but <code>setPlayerLimit</code> does not because, for some reason, it is not being passed the <code>playerId</code>.</p>