Я пытаюсь добавить LoadingController в мое приложение Ioni c 5.
С приведенным ниже кодом появляется счетчик загрузки:
async presentLoading() {
const loading = await this.loadingCtrl.create({
message: 'Please wait...',
});
await loading.present();
}
getPosts() {
this.posts = [];
this.presentLoading();
query.get()
.then((docs) => {
docs.forEach((doc) => {
this.posts.push(doc);
})
}).catch((err) => {
console.log(err)
})
}
Но я не знаете, как отключить LoadingController после заполнения массива posts .
Может кто-нибудь показать мне, как это делается?