angularjs - Refreshing $translate after language changed -
i have problem refreshing $translate property. initially, set "eng". function takes "de" , set it. when retrieve parameter 'hey' still value english. not why.
$rootscope.changelanguage = function(languagekey) { $translate.uses(); //eng $tanslate('hey'); // property eng $translate.uses(languagekey); $translate.uses(); //de $translate('hey'); // property eng !!! };
$rootscope.changelanguage = function(languagekey) { $translate.uses(); //eng $tanslate('hey'); // property eng $translate.uses(languagekey).then(function(data){ $scope.text = $tanslate('hey'); }); //de };
angularjs angular-translate
No comments:
Post a Comment