I am building an app in Angular/Ionic and would like to use the ion-loading component to show a loading icon while the page is still loading.
However, I can't find a lot of information about this in the documentation, but how do you actually check if all content has been loaded? It seems you have to assign a duration to the ion-loading component. Could someone point me in the right direction?
As a kind of workaround (code below) I forced the app to load everything sequentially but this is not ideal, because I'd still like the app to perform some actions in parallel to increase the loading speed.
loading: any;
async presentLoading() {
this.loading = await this.loadingController.create({
message: 'Loading...'
});
await this.loading.present();
}
async initializeApp() {
this.presentLoading();
await this.getData();
await this.getCurrentDate();
await this.loading.dismiss();
}
ngOnInit() {
this.initializeApp();
}