title: How to inject my service into interceptor?
body: <p>I have created interceptor as follows:</p>
  
  <pre><code>(function() {
      'use strict';
      angular.module('sbApp').factory('ErrorResponseInterceptor', ErrorResponseInterceptor).config(ErrorResponseInterceptorConfig);
  
      ErrorResponseInterceptorConfig.$inject = [ '$httpProvider' ];
      ErrorResponseInterceptor.$inject = [ '$rootScope', '$q', '$injector'];
  
      function ErrorResponseInterceptorConfig($httpProvider) {
          $httpProvider.interceptors.push('ErrorResponseInterceptor');
      }
  
      function ErrorResponseInterceptor($rootScope, $q, $injector) {
      // Here I handle my http responses
  
      }
  })();
  </code></pre>
  
  <p>I have other service defined in file <code>myService.js</code> I want to use methods of this service in interceptor above, so I did following changes in the above code :</p>
  
  <pre><code>(function() {
      'use strict';
      angular.module('sbApp').factory('ErrorResponseInterceptor', ErrorResponseInterceptor).config(ErrorResponseInterceptorConfig);
  
      ErrorResponseInterceptorConfig.$inject = [ '$httpProvider' ];
      ErrorResponseInterceptor.$inject = [ '$rootScope', '$q', '$injector', 'myService'];
  
      function ErrorResponseInterceptorConfig($httpProvider) {
          $httpProvider.interceptors.push('ErrorResponseInterceptor');
      }
  
      function ErrorResponseInterceptor($rootScope, $q, $injector, myService) {
          // Here I handle my http responses
  
      }
  })();
  </code></pre>
  
  <p>I have got following error:</p>
  
  <pre><code>Uncaught Error: [$injector:unpr] Unknown provider: myServiceProvider &lt;- myService &lt;- ErrorResponseInterceptor &lt;- $http &lt;- $translateStaticFilesLoader
  </code></pre>
  
  <p><code>myService.js</code> code :</p>
  
  <pre><code>(function() {
      'use strict';
      angular.module('sbApp').factory('myService', myService);
  
      myService.$inject = [ '$rootScope', '$http', 'restAPIService', '$log',
              '$filter', '$interval', '$location' ];
  
          function myService($rootScope, $http, restAPIService, $log, $filter,
                  $interval, $location) {
                  ......
              return {
                  add : add,
              };
              .....
              function add(module, event) {
              var e = {
                ..........
              }
              .......     
                  return $rootScope.myarray.push(e);
              }
  
          }
      })();
  </code></pre>
  
  <p>Is it allowed to use <code>myService</code> into interceptor, How can I pass it to interceptor?</p>