mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
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:
committed by
Manu MA
parent
34ae9045b7
commit
a04197baef
@ -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',
|
||||
|
||||
Reference in New Issue
Block a user