setActiveLang() re-executes all requests made #828
Unanswered
LorenzoVaccher01
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a problem when I try to change the active language with
this.translocoService.setActiveLang(lang);
What happens is: the language is changed but with the re-rendering of the page the requests that the user had previously made are made again. I don't understand this behavior!
I made some requests, changed the language (Transloco loaded the new language via the Loader and through a request I updated the language in the DB) and exactly the same requests were made before the language was changed.
When I comment
this.translocoService.setActiveLang(lang);
(see the code below) the problem does not occur. Anyone have any ideas on how to fix it?Changing the language is managed by a component which, at the click of a button, performs these operations:
Source code of the
transloco-root.module.ts
file:Source code of the
transloco-loader.ts
file:Beta Was this translation helpful? Give feedback.
All reactions