My Ionic app was working fine and I haven't done anything to it but suddenly I am getting this error and I don't know why.
"Error: Uncaught (in promise): removeView was not found
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;
}
}