riccardomariani / odata-v4-ng

OData service for Angular
MIT License
27 stars 5 forks source link

HttpClientModule must not be imported in libraries #8

Open adestis-ds opened 5 years ago

adestis-ds commented 5 years ago

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!

kees-wiegel-visma commented 6 months ago

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

kees-wiegel-visma commented 6 months ago

@riccardomariani I suggest to close this issue