【发布时间】:2019-12-23 12:38:24
【问题描述】:
我创建了一个像这样创建加载的简单函数
async presentLoading() {
const loading = await this.loadingController.create({
message: 'Please Wait...',
});
await loading.present();
}
当像这样获取数据时,我正在关闭加载器
getUserData(){
console.log(this.userID);
this.api.getCompanyEmploye(this.userID).subscribe(res => {
this.loadingController.dismiss(); //closing here
console.log(res);
this.user = res.records[0];
this.familyMembers = res.records[0].family_members;
});
}
我在构造函数中调用这两个函数
constructor(public loadingController: LoadingController){
this.presentLoading();
this.getUserData();
}
显示错误ERROR Error: Uncaught (in promise): overlay does not exist
【问题讨论】: