Reputation: 375
I'm using @ngx Translate Service. Inside a template, you can use it this way, where 'stringName' is a key inside a JSON file:
{{ 'stringName.subStringname' | translate }}
My problem is that I have to build the key name inside the template, using a string and a variable (whose value is 'subStringname') from the component.ts. I need to build something like this:
{{ `stringName.${variable}` | translate }}
What's the right synthax?
Upvotes: 0
Views: 156