title: How to use angularJS interceptor to only intercept specific http requests?
body: <p>I know how to intercept ALL requests, but I only want to intercept requests from my resources.</p>
  
  <p>Does anyone know how to do this?</p>
  
  <pre><code>services.config(['$httpProvider',function($httpProvider) {
      $httpProvider.interceptors.push('myHttpInterceptor');
  }]);
  
  services.factory("userPurchased", function ($resource) {
      return $resource("/api/user/purchases/:action/:item", 
          {}, 
          {
              'list': {method: 'GET', params: {action: 'list'}, isArray: false},
              'save': {method: 'PUT', params: {item: '@item'}},
              'remove': {method: 'DELETE', params: {item: '@item'}},
          }
      );
  });
  
  services.factory('myHttpInterceptor', function($q,$rootScope) {
      // $rootScope.showSpinner = false;
      return {
  
        response: function(response) {
          $rootScope.showSpinner = false;
          // do something on success
          console.log('success');
          console.log('status', response.status);
          //return response;
          return response || $q.when(response);
        },
  
       responseError: function(response) {
          // do something on error
          $rootScope.showSpinner = true;
          console.log('failure');
          console.log('status', response.status)
          //return response;
          return $q.reject(response);
        }
      };
    });
  </code></pre>