I am receiving the following strange dependency injection behavior when using custom HttpInterceptors in angular 5+.
The following simplified code works fine:
For me @Benjineer answar helped to provide as a dependency in app.module.ts the required sercvice.
Although what is interensting, in the order you add as a dependency in app.module.ts you get it in the constructor of the service.
For Example: in the app module you provide in the order of AuthService, ErroMsgService
deps: [AuthService, ErrorMsgService]
in the HttpInterceptor constructor you have to create them in the same order
constructor(
private authService: AuthService,
private errorService: ErrorMsgService
) {}