i would like to add an animation to the screen until the projects are loaded.
constructor(
public platform: Platform,
private network: NetworkService,
public navContrl: NavController,
public modalCtrl: ModalController
) {
this.loadProjects();
this.admin = this.network.isUserAdmin();
}
loadProjects() {
this.network.getAllProjects()
.then(projects => this.projs = projects)
.catch(err => this.logout());
}
my first thought was to implement a settimeout which is the worstcase solution. is there a good way to solve this?
you need to import the loader and use it accordingly to your async code:
Not sure if you posted the full code sample in your case. So I hope this will help. See usage here: https://ionicframework.com/docs/api/components/loading/LoadingController/