Search code examples
ionic2ionic3ngx-translate

Pass translated value using ngx-translate in Ionic


I am trying to find a way to pass a translated value using ngx-translate in Ionic (I want to do it in ion-card).

Of course I can display the value like:

<h2> {{ 'DATA' | translate }} </h2>

But how do I pass the result as a parameter?

I tried:

<ion-card (click)="gotoFunction('DATA' | translate)">
</ion-card>

Solution

  • I solved it by doing the translation in the component class, instead of the template, using the ngx-translate get() method.