Search code examples
ionic-frameworkangular-translate

Using ionic translate item as a variable


I am new in Ionic framework and I want to use translate item as variable in ng-if condition. The {{ "country" | translate }} displays a value to my page but I want to use this value in the below condition.

<div ng-if="country=='my country'"> This is my country </div>

But I don't how to use this, Thanks


Solution

  • Using ionic translation in If Statement:

    <div ng-if="('country'|translate) == 'afghanistan'">
      This is Afghanistan
    </div>