So the answer to your question is you have to use provideHttpClient(withInterceptorsFromDi()),if you are class based interceptor.
or if you are using function based then use provideHttpClient(withInterceptors()) in providers.
Thank you