-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpInterceptor not triggering with lazy loaded modules #14
Comments
Yes, makes sense. While TranslateService is provided in the root, the lazy module makes a copy of HttpClientModule and corresponding providers if any. Thanks for reporting, I will try to fix this issue and move HttpClientModule to the app level. |
As the library requires that |
@micobarac the unit tests are fine, those need to import HTTP module into the TestBed. Feel free to check this PR and see if that fixes your issue: #15 |
@DenysVuika I have tried the commit you suggested and it still doesn't work. My I think that you haven't removed |
The 1.2 is not published to NPM yet. I removed the file from module but leaving in unit tests, those have nothing to do with your application. |
I added the latest commit from the git repository, not from NPM. |
I may need some example to reproduce the issue. So far the library code has no direct imports of the HttpClientModule if you check the repo. |
Perhaps I haven't imported the latest commit well. How do I do it with Yarn, using your Git commit with fix? |
I am publishing 1.2.0 right now, you will be able to check in a while directly from NPM |
Ok, thanks :) |
1.2.0 is out: https://www.npmjs.com/package/@ngstack/translate/v/1.2.0 |
I have tried the 1.2.0 version from NPM and it works like a charm. Thanks a lot. |
Custom
HttpInterceptor
not triggering with lazy loaded modules, when usingTranslateModule
as stated in docs.It's a complex project, so I cannot show the example code.
The problem with lazy loaded modules and
HttpInterceptor
is thatHttpClientModule
can only be imported once in the project insideapp.module.ts
. Looking into this library's code, I found thatHttpClientModule
is imported internally, which, I presume, could cause this problem.The files to look for these imports are:
projects/translate/src/lib/translate.module.ts
projects/translate/src/lib/translate.pipe.spec.ts
projects/translate/src/lib/title.service.spec.ts
projects/translate/src/lib/translate.service.spec.ts
The text was updated successfully, but these errors were encountered: