Answer the question
In order to leave comments, you need to log in
Am I understanding the decorator correctly?
I am using angular-translate for translation. But I really need to have this feature
$scope.CurrentLanguage = function () {
var CurrentLanguage = $translate.use() || $translate.storage().get($translate.storageKey()) || translate.preferredLanguage();
return CurrentLanguage;
};
working "everywhere" in the application. Can I do in the general config something likeapp.config(function($provide) {
$provide.decorator('$translate', function($delegate) {
$delegate.getCurrentLanguage = function() {
var getCurrentLanguage = $translate.use() || $translate.storage().get($translate.storageKey()) || $translate.preferredLanguage();
};
return $delegate;
});
});
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