I am using a ion-select to show currency options. This is my code:
<ion-item>
<ion-label>Currency</ion-label>
<ion-select>
<ion-select-option value="USD">Dollar</ion-select-option>
<ion-select-option value="EURO">Euro</ion-select-option>
</ion-select>
</ion-item>
When the user choose one of the currency the prices will shown in that chosen currency. I have read in the Angular documentation there is a currencypipe.
https://angular.io/api/common/CurrencyPipe
I use this pipe like this:
<ion-col>
<ion-badge>Current price: {{item.price | currency}}</ion-badge>
</ion-col>
You can specify this pipe like this to show the currency the user wants.
<ion-col>
<ion-badge>Current price: {{item.price | currency:'USD'}}</ion-badge>
</ion-col>
The requirement I try to achieve is, I want that the user can select te currency from the ion-select and pass this value in the CurrencyPipe. How can I achieve this?
Source I tried: