title: Cannot read property 'intercept' of undefined
body: <p>I have an interceptor which I want to provide in the app.module.ts as a const. So I used a separate file to declare all interceptors as an array of objects.</p>
  <p>In http-interceptors/index.ts</p>
  <pre><code>import { HTTP_INTERCEPTORS } from &quot;@angular/common/http&quot;;
  import { ErrorIntercept } from &quot;./error.interceptor&quot;;
  import { CompanyInfoService } from &quot;../services/companyInfo.service&quot;;
  
  export const interceptorProviders = [
  { 'provide': HTTP_INTERCEPTORS, 'useclass': ErrorIntercept, 'multi': true, 'deps': [CompanyInfoService] }
  ];
  </code></pre>
  <p>In my app.module.ts,</p>
  <pre><code>import {interceptorProviders} from './http-interceptors/';
  ...
  @NgModule ({
      ...
      providers: [interceptorProviders]
  })
  </code></pre>
  <p>This throws the error - <strong>Cannot read property 'intercept' of undefined</strong></p>
  <p>However, when I directly provide the interceptor in the app.module.ts as below, it works as expected.</p>
  <pre><code>providers: [{
      provide: HTTP_INTERCEPTORS,
      useClass: ErrorIntercept,
      multi: true,
      deps: [CompanyInfoService]
  }]
  </code></pre>
  <p>I am not able to figure out the reason for this... so do let me know your thoughts. TIA!</p>