Angular Translation sometimes not translated with one-time binding

I am using Angular 1.x and the Angular Translate module. Recently, I switched all of my translation bindings from two sides to disposable. Everything worked fine, but one day I noticed that sometimes, if I started to refresh the page, translations are not actually translated.

Example:

{{ ::'MyTranslationKey' | translate }}

In 90% of cases, the result is correct. However, in the remaining 10%, the result is:

MyTranslationKey

What is the reason for this and how to fix it?

Edit:

This does not happen with elements that are inside ng-if, ng-repeat or directives. when they are inside the children's area.

+4
source share
2 answers

angular -translate . , 10% , , . , translate - ; ng-if , ng-if='loaded'.

+3

Try:

<element translate>
    {{::'MyTranslationKey'}}
</element>

, translate ( Pascal Precht, Angular ).

+3

Source: https://habr.com/ru/post/1673690/


All Articles