ionic toast controller code example
Example 1: ionic toast
constructor(public toastController: ToastController) {}
async presentToast() {
const toast = await this.toastController.create({
message: 'Your settings have been saved.',
duration: 2000
});
toast.present();
}
Example 2: ionic toast stacked
showOnceToast() {
this.toastController.dismiss().then((obj) => {
}).catch(() => {
}).finally(() => {
this.showToast();
});
}Copy