From Angular 1.3, filters are idle, which means that filters will only be updated when their input is changed.
If you want to update your filter, you need to make your filters $ stateful .
app.filter('translate', translate);
translate.$inject = ['$rootScope'];
function translate($rootScope){
filter.$stateful = true;
return filter;
function filter(str) {
return i18n[$rootScope.currentLang][str];
};
}
Filters will be executed on every $ digest, but this is not practical with perfm.
source
share