Do not import `HttpClientModule`
See original GitHub issueThis might sounds a bit weird.
And I hope someone tells me I’m wrong.
I do have some interceptors in my app.
I do use ngx-markdown
within a lazy loaded module, let’s call it LazyModule
.
From LazyModule
, every http request is not caught by any of my interceptors.
I’ve been digging on why this lazy loaded module especially, because I have others and it works fine with them.
Then I’ve found that issue: https://github.com/angular/angular/issues/20575
HTTP_INTERCEPTORS are reset when a lazy loaded module imports another module importing HttpClientModule
and yes it’s an intended behavior. So it’s not going to change and we have to deal with it.
I have no idea how to manage that, but could you somehow remove the imports: [HttpClientModule]
on this line?
Otherwise it means that people cannot use ngx-markdown
into a lazy loaded module if they rely on some interceptors.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
Look good at first sight … I’m gonna look at it tonight from home. Oh and by the way thanks a lot for doing the tests, usually people don’t care so much about it 😄
@jfcere I’ve added a commit. Let me know what you think 😃