Ionic 4 - How to dIsplay error result in alert
Posted: Fri Sep 11, 2020 9:51 pm
Hello
How can I use the result of the error on the message text of the alert?
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hello
How can I use the result of the error on the message text of the alert?
Hello,
Please use a custom TypeScript there. Only there the error variable is available, so you can use it to display its value in the alert, e.g.:
Code: Select all
await (async () => {
let options = {
'header': 'Error',
'message': JSON.stringify(err),
'subHeader': '',
'buttons': [{
'text': 'OK',
}]
}
let controller = this.Apperyio.getController('AlertController');
const alert = await controller.create(options);
return await alert.present();
})();