Answer the question
In order to leave comments, you need to log in
How to delay the loading of a View until a specific event?
There is a View that uses the DatePicker from the AngularJS-ui-bootstrap distribution.
This plugin uses localization files, which in turn are loaded dynamically depending on the selected locale in the EN or RU user interface.
The problem is that the Locale is loaded AFTER the Display is loaded and rendered.
How to force Angular to render the Display after finishing loading the Localization file.
the tmhDynamicLocale module is used.
Main controller code:
self.loadLocale = function () {
var locale = '';
if($translate.use() == 'en') { locale = 'en-us'; }
if($translate.use() == 'ru') { locale = 'ru-ru'; }
tmhDynamicLocale.set(locale == 'en-us' ? 'ru-ru' : 'en-us')
.then(
tmhDynamicLocale.set(locale == 'en-us' ? 'en-us' : 'ru-ru')
)
.then(function() {
$rootScope.$broadcast('localeLoaded');
console.log('CURRENT LOCALE :: ' + locale);
});
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question