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) {}
presentToast() {
const toast = this.toastController.create({
async presentToast() {
const toast = await this.toastController.create({
message: 'Your settings have been saved.',
duration: 2000
});
toast.present();
}
presentToastWithOptions() {
const toast = this.toastController.create({
async presentToastWithOptions() {
const toast = await this.toastController.create({
message: 'Click to Close',
showCloseButton: true,
position: 'top',