AKH_coder
AKH_coder

Reputation: 25

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>

Upvotes: 0

Views: 343

Answers (1)

AKH_coder
AKH_coder

Reputation: 25

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

Upvotes: 1

Related Questions