I ran into a loading problem, in my case, I have two custom components A & B, each of them has UI and services, and them both show loading when performing background service.
Then I added A & B into same page. When the page got rendered, I got error “removeView was not found”. I figured that there were two loading presenting in the same time, so dismiss() got messed up maybe.
As for loading, I’ve created a custom global LoadingLoader
service, the snippet as following
@Injectable()
export class LoadingLoader {
loader: Loading;
constructor(public loadingCtrl: LoadingController) {
}
presentLoading(content?: string) {
console.log('----- present loading ------ ');
this.loader = this.loadingCtrl.create({
content: content
});
this.loader.present();
}
dismiss() {
console.log('----- dismiss loading ------ ');
this.loader.dismiss();
}
}
As for custom component A or B, it just presented and dismiss loading before and after async calls
Any suggestion to my case?