title: Calling a Service from within a Restangular ResponseInterceptor (ResponseExtractor)
body: <p>I'm trying to expand a Foreign Key field on an element I get from my back end service after adding an item to a collection, using Restangular.</p>
  
  <p>The service responds to my POST with the element, including a <code>url</code> field linking to the related object, and I already have a service in place for those objects.</p>
  
  <p>The response looks like:</p>
  
  <pre><code>{
      "url": "http://api.example.com/resources/6/", 
      "name": "Harry", 
      "role": "http://api.example.com/roles/1/", 
  }
  </code></pre>
  
  <p>and I'd like to expand the <code>role</code> field to something like:</p>
  
  <pre><code>{
      "url": "http://api.example.com/resources/6/", 
      "name": "Harry", 
      "role": "Administrator", 
  }
  </code></pre>
  
  <p>so far I have the following:</p>
  
  <pre><code>Configurer.setResponseInterceptor(function(data, operation, what, url, response, deferred) {
      if ((operation == 'post' || operation == 'put') &amp;&amp; what == 'resources' &amp;&amp; 'role' in data &amp;&amp; data.role.substr(0,4) == 'http') {
          console.log('Role URL instead of name -- change this');
      }
      return data;
  });
  </code></pre>
  
  <p>and I'd ideally like to call my existing service which wraps Restangular; do I need an injector? Or is there a better way?</p>