I am evaluating the Ignite UI for Angular right now and after I imported the IgxGridModule to my FeatureModule, my HttpInterceptors are not working anymore.
If I add the Module to my AppModule, the interceptors are still working, but I have built several libraries and I am importing them to my AppModule. If I reference the IgxGridModule inside one of them, my HttpInterceptors of the whole application are not working anymore
- libs
- CoreLib
- myHttpinterceptor.ts
- Feature1Module
-Feature1.module.ts
# import IgxGridModule
- src
- App
- app.module.ts
# import feature1Module
# import CoreLib
# provide myHttpInterceptor
Is the Library affecting default angular behavior?
When will you plan to fix it?
Hello Jürgen,
Thank you for the additional information.
After looking into this it seems that indeed there is import for the HttpClientModule inside the library:
https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/icon/index.ts#L14
Which is used for the IgxIcon, since it needs to allow loading external icons.
You can log this as an issue in our public repo and reference the related line and the related angular issue so that this may be fixed in one of the future versions:
https://github.com/IgniteUI/igniteui-angular
Let me know if there anything else I can help you with.
Regards,
Maya Kirova
because I couldn't reproduce the issue by creating a new simple app, I lived with a workaround so far. The reason why I couldn't reproduce it was because the use case is a little bit more complex yes not unusual. I found a github issue which explains exactly the problem we are facing with the igxgrid - library
github.com/.../20575
We are loading the IgxGridModule inside of a lazy loaded feature module. Somewhere inside of the IgxGridModule, an import of HttpClientModule must happen, because from that moment, our HTTP_INTERCEPTORS are not firing anymore. Regarding to the angular devs inside of that issue I mentioned, this is a mistake inside of your library, or a library you are using.
Thank you for posting in our forum.
Ignite UI for Angular does not affect the default Angular behavior, as it does not handle HTTP requests per se.
In order to be sure your question gets answered correctly, I would appreciate some additional information:
Providing me those details would allow me to try to reproduce this behavior on my side, investigate it, and find what is causing the problem so I could give you a more precise answer.