Deleting a component is not a solution to any problem.
Cause of issue: There are multiple calls to dismiss method of loading component.
Solution:
While creating the loader, check if the loader instance is not already present, only then create another instance.
Similarly, while dismissing the loader, check if the loader instance does exists, only then dismiss it.
Code:
constructor(private _loadingCtrl: LoadingController){}
loading;
showLoading() {
if(!this.loading){
this.loading = this._loadingCtrl.create({
content: 'Please Wait...'
});
this.loading.present();
}
}
dismissLoading(){
if(this.loading){
this.loading.dismiss();
this.loading = null;
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…