title: Services in AngularJS
body: <p>I'm learning AngularJS and I've a little problem for services. The official tutorial gives an example for custom services with REST :</p>
  
  <pre><code>angular.module('phonecatServices', ['ngResource']).
      factory('Phone', function($resource){
          return $resource('phones/:phoneId.json', {}, {
              query: {method:'GET', params:{phoneId:'phones'}, isArray:true}
          });
      });
  </code></pre>
  
  <p>So I made the same code with different names/url and it works.</p>
  
  <p>I would like to pass a parameter to this service (an id in the url).
  I tried to use $routeParams in it but it didn't work. Finally I found an other way to declare several function in the same service, so I made that :</p>
  
  <pre><code>factory('Article', function($resource) {
      return {
          getList: function(categoryId) {
                  return $resource('http://...', {
                      query: {method:'GET', isArray:true}
                  });
              }
          }
      })
  </code></pre>
  
  <p>But it doesn't work for a REST call (with return 'Hello' for example, it's ok).</p>
  
  <p>Do you know how do that ?</p>
  
  <p>Thank you !</p>