docs(toast): fix angular usage

The create method returns a promise. Other examples deal with this using async-await, so I did the same thing in this instance.
This commit is contained in:
Adrián de la Rosa
2018-05-11 14:43:51 +02:00
committed by Manu MA
parent 34ae9045b7
commit a04197baef

View File

@ -11,16 +11,16 @@ export class ToastExample {
constructor(public toastController: ToastController) {} constructor(public toastController: ToastController) {}
presentToast() { async presentToast() {
const toast = this.toastController.create({ const toast = await this.toastController.create({
message: 'Your settings have been saved.', message: 'Your settings have been saved.',
duration: 2000 duration: 2000
}); });
toast.present(); toast.present();
} }
presentToastWithOptions() { async presentToastWithOptions() {
const toast = this.toastController.create({ const toast = await this.toastController.create({
message: 'Click to Close', message: 'Click to Close',
showCloseButton: true, showCloseButton: true,
position: 'top', position: 'top',