How to dismiss my simple Ionic 4 loader (spinner), when the data is ready? There must be a simple way to do that, but somehow I cannot find a good example.
Spinner:
async runSpinner(loadingId: string) {
const loading = await this.loadingController.create({
id: loadingId,
message: 'Loading...'
});
await loading.present();
const { role, data } = await loading.onDidDismiss();
}
Data (when this is loaded, spinner should stop)
this.someService
.getCustomizationResult(requestData)
.subscribe(data => {
// if (data) {
// ...
});
I've tried to do it with setting a boolean, but it didn't work. Thanks in advance!