I am trying to create a filter for showing the elapsed date and time in angular js and is working fine. Now I am trying to add translation to it but that time its showing the keys instead of the values.I think the issue is because the translation is not loaded while the filter is executing.
I am trying translation in the code like
if(hours){
result+= " "+hours+$translate.instant("elapsedFull.hours");
}
if(minutes){
result+= " "+minutes+$translate.instant("elapsedFull.minutes");
}
if(seconds){
result+= " "+seconds+$translate.instant("elapsedFull.seconds");
}
Please check the plunker link and let me know how can i fix the issue.
Plunker
Copyright Notice:Content Author:「robin」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/42063403/issue-with-angular-translation-in-custom-filter