Sredoje Cutovic
Sredoje Cutovic

Reputation: 133

Angular js wait for translate to finish rendering

I put https://docs.angularjs.org/api/ng/directive/ngCloak directive to my body element on the page and every element witch has angular in it , but it looks like it doesnt work on angular-js translate. I see translate variables on the page and after one second they are translated.Is there something to fix this?

Upvotes: 1

Views: 3251

Answers (1)

Pascal Precht
Pascal Precht

Reputation: 8893

This is because angular-translate is executed after angular itself is ready. What you need is the translate-cloak directive. http://angular-translate.github.io/docs/#/api/pascalprecht.translate.directive:translateCloak in combination with the according method on $translate service http://angular-translate.github.io/docs/#/api/pascalprecht.translate.$translate#methods_cloakclassname

Hope this helps.

Upvotes: 4

Related Questions