title: How can I pass parameters in an Angular.js Controller to a Resource?
body: <p>So I have the following controller where I inject a constant, APIKEY.</p>
  
  <pre><code>myApp.controller('JobsCtrl', ['$scope', 'Jobs', 'APIKEY', function($scope, Jobs, apiKey) {
    var promise = Jobs.query().$promise;
    // do more awesome programming
  }
  </code></pre>
  
  <p>I want to pass the apiKey to the following service but can't figure out for the life of me how to do it.</p>
  
  <pre><code>myApp.factory('Jobs', ['$resource', function ($resource) {
    return $resource('/someurl/:id', {id:'@id'}, {
      query: { method: 'GET', headers: {'Authorization': apiKey} }
    });
  }]);
  </code></pre>
  
  <p>Thanks!</p>