title: The better approach to design AngularJS services
body: <p>I'm writing an AngularJS client application that would interact with a REST server.</p>
  
  <p>To manage the client / server interaction I'm using the <a href="http://docs.angularjs.org/api/ngResource.%24resource" rel="nofollow">$resource</a> abstraction.
  Actually I'm writing every resource as a separated <a href="http://docs.angularjs.org/guide/dev_guide.services.creating_services" rel="nofollow">service</a> and injecting it only in the controllers that are gonna use it.</p>
  
  <p>I've started to develop using the <a href="https://github.com/angular/angular-seed" rel="nofollow">angularjs-seed</a>, so in my separed <code>services.js</code> file I've got an increasing number of services:</p>
  
  <pre><code>angular.module('testReqService', ['ngResource']).
      factory('TestReq', function($resource){
      return $resource('http://test-url.com/api/test', {}, {});
  });
  angular.module('registerService', ['ngResource']).
      factory('Register', function($resource){
      return $resource('http://test-url.com/api/user/new', {}, {});
  });
  //More services here...
  </code></pre>
  
  <p>Everything works fine, but I'm wondering if this is the best approach.</p>
  
  <p>So, is better to write separate services for different <code>REST</code> requests and inject them only in the controllers that need it, or a better approach is to write a single service with different methods and URL for every request?</p>