Partial translations not lazy loading when using with router-ui resolve
See original GitHub issueHi,
I’m trying to get the translations to be loaded lazily by adding the “addPart” within one of the resolve method in my router, but this is not working.
Here is the code:
locales: function($translatePartialLoader, $translate) {
$translatePartialLoader.addPart('contacts');
console.log('addPart');
return $translate.refresh();
}
When I load the application I can see the “addPart” logged in the console, but the translations are not loaded and the file has not been loaded (not present in the network). However, when I navigate within the application the partical is loaded immediately and everything works as excepted.
Do you have any idea why ?
Best regards Daniel
Issue Analytics
- State:
- Created 9 years ago
- Comments:19 (8 by maintainers)
Top Results From Across the Web
Lazy-loading feature modules - Angular
Setting up a lazy-loaded feature module requires two main steps: Create the feature module with the Angular CLI, using the --route flag. Configure...
Read more >How to load Angular translate with external modules loaded ...
I solved using in the main app controllert a new function called when the link in the navigation is clicked:
Read more >Lazy loading and code splitting in Vue.js - Vue School Blog
The answer is easy — lazy loading and code splitting. As the name suggests lazy loading is a process of loading parts (chunks)...
Read more >Lazy Loading Routes | Vue Router
With webpack #. Sometimes we may want to group all the components nested under the same route into the same async chunk. To...
Read more >How to Lazy Load in Ionic Angular - Ionic Blog
Lazy loading is expressed through how the Angular routes are setup: ... NoPreloading: Does not perform any preloading of lazily loaded ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ptgamr, do you call the
refresh
method of the$translate
service?Indeed, adding a $translateProvider.use(); in the config block solves the issue in 2.7.0
Thanks !