Reputation: 147
I try to get value from a component variable to translate with lazyloading
<label class="text-white" >{{ 'profil.city' | translate }} </label>
<input class="text-white bg-transparent" value="{{user.town}}"> /* Works*/
<label class="text-white" >{{ 'profil.sex' | translate }} </label>
<input class="text-white bg-transparent" value="{{ '{{user.sex}}' | translate}}"> /* Don't Works */
I get error with the
{{ '{{user.sex}}' | translate}}"
I Just want to get user.sex value which is a entry in the language.json to translate.
How can I get the value to translate it Correctly ?
Thank you all !
Upvotes: 1
Views: 354
Reputation: 51
just remove the semi colon do like this :value="{{user.sex | translate}}"
Upvotes: 0
Reputation: 7456
You can go back to normal evaluation instead of template expansion:
[value]="'user.sex' | translate"
or also this will work
value={{ 'user.sex' | translate }}
Upvotes: 0