Interceptor not intercepting http requests (Angular 6)

前端 未结 5 860
自闭症患者
自闭症患者 2021-01-01 11:10

I\'m in the proces of adding an interceptor to my angular 6 project. To make calls to my API, I need to add a bearer token to all calls. Unfortunately the interceptor does n

5条回答
  •  庸人自扰
    2021-01-01 11:45

    In my case interceptor wasn't getting involved for service calls because I had imported HttpClientModule multiple times, for different modules.

    Later I found that HttpClientModule must be imported only once. Doc ref

    Hope this helps!

提交回复
热议问题