odata-v4-ng icon indicating copy to clipboard operation
odata-v4-ng copied to clipboard

HttpClientModule must not be imported in libraries

Open adestis-ds opened this issue 5 years ago • 2 comments

According to this threat https://github.com/angular/angular/issues/20575 HttpClientModule must not be imported by a library. In order to use HTTP_INTERCEPTORS (e.g. for authentication) HttpClientModule has to be imported by the root or a core module. If it is also imported by a library then the HTTP_INTERCEPTORS are not used in lazy loaded modules.

You should rely only on DI in order to get the HttpClient!

This problem prevents me from using your library because it breaks authentication in my lazy loaded modules!

adestis-ds avatar Jul 22 '19 16:07 adestis-ds

Fixed in https://github.com/ebenefits/odata-v4-ng/pull/32

kees-wiegel-visma avatar May 10 '24 13:05 kees-wiegel-visma

@riccardomariani I suggest to close this issue

kees-wiegel-visma avatar May 10 '24 13:05 kees-wiegel-visma