IONIC开发过程中,遇到初始化方法不执行的情况

ngOnInit()方法偶尔不会执行,原始数据没法清楚掉,这个是什么原因呢?

async ngOnInit() {
this.root.currentMenu = {
'name': '接待',
'code': 'reception',
'type': 'menu',
'display': 'Y',
'path': '/marketing/reception',
'menuSource': 'LinkGuideMobile',
};
// 初始化接待数据
await this.initReception();
// 设置tab页签
this.tabs = [
{title: '信息录入', component: ReceptionBasicComponent, data: {receptionItem: this.receptionItem}},
{title: '礼品记录', component: PresentComponent},
];
}

/**

  • 初始化接待数据
  • @author gemini
  • @date 2018/10/31 */ async initReception() { // 调用service获取service对象 this.receptionItem = await this.receptionService.createNewReception(); // 将service设置到接待对象中 this.data.receptionItem = Object.assign(this.receptionItem, this.data.receptionItem); }