ngx-slider
ngx-slider copied to clipboard
Calling async function inside Options translate
Hi, I'm using currency converter in my application (using Forex rate). I want to display exchange rate in the slider. Since translate is not an async
function what's the workaround? I tried below code which will of course return Promise
object
this.options = {
floor: 0,
ceil: 1000,
step: 50,
animate: false,
translate: (value: number): any => {
return (async (): Promise<number> => {
return await Promise.resolve(this.currencyService.getExchangeRate({ source: 'USD', target:'AED, amount: value }));
})();
}
};