我正在使用自定义过滤器来翻译ng-options
选择元素的。翻译工作正常,直到我$translate.use()
用来更改语言。我希望ng-options
重新翻译。有谁知道如何做到这一点?
这是我的客户过滤器:
function translateAndFormatPhoneCountry(translateFilter) {
return function(phoneCountry) {
return translateFilter(phoneCountry.name) + " (" + phoneCountry.countryCode + ")";
};
}
这是我的选择元素:
phoneCountry
通常看起来像这样:
{"name": "UNITED_KINGDOM", "countryCode": "+44"}