2014-10-31 58 views
0

我正在使用自定義過濾器翻譯select元素的ng-options。翻譯工作正常,直到我使用$translate.use()來更改語言。我想ng-options重新翻譯。有誰知道如何做到這一點?

這是我的客戶過濾器:

function translateAndFormatPhoneCountry(translateFilter) { 
    return function(phoneCountry) { 
     return translateFilter(phoneCountry.name) + " (" + phoneCountry.countryCode + ")"; 
    }; 
} 

,這是我選擇的元素:

phoneCountry通常是這樣的:

{"name": "UNITED_KINGDOM", "countryCode": "+44"} 

回答