Error: Uncaught Ionic 2

Asked

Viewed 76 times

1

I have this:

    let loader = this.loadingCtrl.create({
          dismissOnPageChange: true,
        });

    loader.present().then(authData => {

        let alert = this.alertCtrl.create({
          title: '',
          message: 'Cadastrado com sucesso!',
          buttons: [
            {
              text: 'Ok',
              handler: data => {
                this.navCtrl.setRoot(LoginPage);
              }
            }
          ]
        });

        alert.present();

    });

Code worked however, got following error:

EXCEPTION: Uncaught (in Promise): false

1 answer

0


import { Component} from '@angular/core';
import { LoadingController } from 'ionic-angular';

@Component({
  selector: 'page',
  templateUrl: 'page.html',
})

export class AlgumaPage {

	loader : any;

	constructor(public loadCtrl : LoadingController) {}

	ionViewDidLoad() {
		//executa quando carrega a tela
	}

	/**
	* Metodo utilizado para abrir o load sincronizando
	* Esse loader tem a propriedade duration, assim, ele vai ser fechado automatico
	*/
	abrirLoading(){
	  this.loadCtrl.create({
		content: "Sincronizando...",
		duration: 2000
	  }).present();
	}
//-------------------------------------------------------------------------------------	
	/**
	* Metodo utilizado para abrir o sincronizando
	*/
	abrirLoading(){
	 this.loader = this.loadCtrl.create({
	   content: "Sincronizando..."
	 });
	 this.loader.present();
	}

	/**
	* Metodo utilizado para fechar o sincronizando
	*/
	fecharLoading(){
		this.loader.dismiss();
	}
	
}

Above I am showing two Oader, one with time to close and the other opening and closing, I hope you answer.

Browser other questions tagged

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