Ionic problem 4 . present();

Asked

Viewed 31 times

0

I am studying Ionic and I am in the Ionic CLI version : 4.12.0, I am facing a problem in my home constructor, when using the present() method in my loading variable presents the following error: "Property 'present' does not exist on type 'Promise'. Did you Forget to use 'await'? "

 constructor(public navCtrl: NavController, 
          private _htpp: HttpClient,
          private _loadingCtrl: LoadingController) {


let loading = this._loadingCtrl.create({
  message: 'Carregando...' 
});

loading.present();

Can anyone tell me how to fix this problem ?

1 answer

0


Christian,...

async loadingToast() {
    const toast = await this._loadingCtrl.create({
        message: 'Carregando...' 
    });

    return await toast.present();
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.