transloco
transloco copied to clipboard
Bug(directive): Settings scope causes multiple Load-Requests
Is there an existing issue for this?
- [X] I have searched the existing issues
Which Transloco package(s) are the source of the bug?
Transloco
Is this a regression?
No
Current behavior
When using the transloco directive with a scope, the scope gets loaded multiple times. I've modified a random example to show to problem:
https://stackblitz.com/edit/transloco-example-9zmdce?file=src%2Fapp%2Fscope-sharing%2Fscope-sharing.component.html,src%2Fapp%2Fscope-sharing%2Fscope-sharing.component.ts
The TranslocoLoader gets called once, but the Http-Request is invoked multiple times (check Network Log)
Expected behavior
The loader's endpoint should only be called once.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/transloco-example-9zmdce?file=src%2Fapp%2Fscope-sharing%2Fscope-sharing.component.html,src%2Fapp%2Fscope-sharing%2Fscope-sharing.component.ts
Transloco Config
No response
Please provide the environment you discovered this bug in
Transloco: 4.1.0
Angular: 14.0.1
Browser
Chrome 102
Additional context
No response
I would like to make a pull request for this bug
No