Error: Uncaught ionic 2

1

I have following:

    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, I got the following error:

  

EXCEPTION: Uncaught (in promise): false

    
asked by anonymous 12.01.2017 / 21:22

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'm showing two loader, one with time to close and the other opening and closing, I hope it answers.

    
01.02.2017 / 15:50