Is there a way to insert a variable response from a service and then show it on hover? Here is my attempt:
toolTip: string;
async mouseover(params) {
this.handle = setTimeout(() => {
this.toolTip = this.checkSaldo(10, 'FRA');
this.show = true;
}, 4000);
}
checkSaldo(amount: any, currencyCode: any): Promise<string> {
return new Promise((resolve) => {
this.restService.getByParam('recalculatedSaldo', { amount: amount, currency: currencyCode }).subscribe(response => {
resolve(response.payload);
});
})
}
However, I encountered an error with the toolTip
variable:
Type 'Promise' is not assignable to type 'string'
Any suggestions to resolve this issue?