DEV Community

Cover image for Angular Interceptor not working
adruh
adruh

Posted on

Angular Interceptor not working

My angular interceptor is not handling all http request
when calling login service.
Image description.

Discussion (3)

Collapse
carboncs16 profile image
Punya Purba Pattnaik

Please verify the module in which you have added interceptor as a providers. Below is an example how to add interceptor in your respective module.

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    CoreModule,
  ],
  providers: [
    [{ provide: HTTP_INTERCEPTORS, useClass: AppInterceptor, multi: true }]
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Enter fullscreen mode Exit fullscreen mode
Collapse
gaurangdhorda profile image
GaurangDhorda

Can you please send more details by email . It will be easy to communicate. Do send email to -- grdtechlab@gmail.com

Collapse
adruh profile image
adruh Author

ok, sure