I'm trying to call loading/Toast/Alert
in Ionic2
in the following scenario. As I'm new to Ionic development, I am not able to figure it out. I am aware it's a silly error.
var dg = document.getElementById('btnregis');
dg.onclick =()=> this.presentLoading();
presentLoading() {
console.log("Registered");
let loading = Loading.create({
content: "Please wait...",
duration: 3000
});
this.navController.present(loading);
this.Reg_success();
}
Reg_success() {
console.log("registration success");
this.Billerlabelview = false;
let toast = Toast.create({
message: "Registering...",
duration: 3000
});
this.navController.present(toast);
}
The reg_Success()
method is not getting called. It throws a similar exception. Is there something I'm missing?