Replacing Strings in HTML with JSON key values

时间:2019-04-08 13:46:12

标签: angular angular-translate angular-pipe

I have made translation that works, but text is changing only in one html component. Imports are correct, because I can use | translate method in differents components. Problem is with getting values from JSON file in other components. When I am writing {{'keyValue.textForReplacing'|translate}} my text appears like keyValue.textForReplacing. It is not imported from JSON file. What's more, I can use all my key: values objects from JSON file only in one html component. I have used this as an example https://github.com/ngx-translate/core

1 个答案:

答案 0 :(得分:0)

尝试{{keyValue.textForReplacing | translate}}