Country Currency Converter


#1

How to make currency converter in ionic? Please help…


#2

See:


#3

i got this link…actually i am new…so i asked. How to implement please help.


#4

Follow the step-by-step installation instructions and try out the sandbox demos.


#5

Actually , i want to use like this… home.html

Amount:
  <ion-item>		
     <ion-label>From:</ion-label>
  		<ion-select [(ngModel)]="fromCurrency">
    		<ion-option value="AUD">Australlian Dollar(AUD)</ion-option>
    		<ion-option value="BGN">Bulgarian Lev(BGN)</ion-option>
    		<ion-option value="CAD">Canadian Dollar(CAD)</ion-option>
    		<ion-option value="CHF">Swiss Franc(CHF)</ion-option>
    		<ion-option value="DKK">Danish Krone(DKK)</ion-option>
    		<ion-option value="GBP">Pound Sterling(GBP)</ion-option>
    		<ion-option value="ILS">Israeli New Shekel(ILS)</ion-option>
    		<ion-option value="INR">Indian Rupee(INR)</ion-option>
    		<ion-option value="JPY">Japanese Yen(JPY)</ion-option>
    		<ion-option value="PHP">Philippine Peso(PHP)</ion-option>
    		<ion-option value="RUB">Russian(RUB)</ion-option>
    		<ion-option value="USD" selected>US Dollar(USD)</ion-option>
		</ion-select>
	</ion-item>


   <ion-item>
		<ion-label>To:</ion-label>

  		<ion-select [(ngModel)]="toCurrency">
    		<ion-option value="AUD">Australlian Dollar(AUD)</ion-option>
    		<ion-option value="BGN">Bulgarian Lev(BGN)</ion-option>
    		<ion-option value="CAD">Canadian Dollar(CAD)</ion-option>
    		<ion-option value="CHF">Swiss Franc(CHF)</ion-option>
    		<ion-option value="DKK">Danish Krone(DKK)</ion-option>
    		<ion-option value="GBP">Pound Sterling(GBP)</ion-option>
    		<ion-option value="ILS">Israeli New Shekel(ILS)</ion-option>
    		<ion-option value="INR" selected>Indian Rupee(INR)</ion-option>
    		<ion-option value="JPY">Japanese Yen(JPY)</ion-option>
    		<ion-option value="PHP">Philippine Peso(PHP)</ion-option>
    		<ion-option value="RUB">Russian(RUB)</ion-option>
    		<ion-option value="USD">US Dollar(USD)</ion-option>
		</ion-select>
	</ion-item>

   <ion-item>
      <ion-label>Result:</ion-label>
      <ion-input [(ngModel)]="result" disabled></ion-input>
</ion-item>
<ion-item class="content__convert">
  <button ion-button (click)="convert()">Convert</button>

home.ts

convert(){

let url = this.fromCurrency + "," + this.toCurrency;
	 //this.http.get(https://apilayer.net/api/live?access_key=b215b3b7f94de5d5b21db336385978bc&format=1).subscribe(data=>{
     this.http.get('http://data.fixer.io/api/latest?access_key=cdb439d4d717454fb60df4a4f18d933e' + "," +url ).subscribe(data=>{

		this.rates = data;
    console.log(this.rates);

  		let from = this.rates[this.fromCurrency];
		    let to = this.rates[this.toCurrency];
  		console.log(from);
  		console.log(to);
  		this.result = (this.amount * to)/from;


	});

#6

error: Object { code: 101, type: “invalid_access_key”, info: “You have not supplied a valid API Access Key. [Technical Support: support@apilayer.com]” }

success: false