我创建了ionic 4应用程序。
我做了什么
- I have disabled the menu at first on app.component.ts
- When ionViewWillEnter() on Map Tab, I have disabled the side-menu
- When ionViewWillLeave() on Map Tab, I have disabled the side-menu
- Side-menu only will enable when to click on the place marker
- I have triggered the event when clicking on place marker
- This event carries the data of place
- I have used the variable 'business' to fill the side-menu
- I have subscribed the event on app.component.ts and assign the
place data to 'business' variable
问题:-
答案 0 :(得分:1)
“业务”变量的数据是否已更新? 如果是这样,也许您可以尝试在ngzone中运行分配代码。
// import zone in your app.component.ts
import { NgZone } from '@angular/core';
// add zone provider to the component constructor
constructor(private zone: NgZone) {
// ...
}
// cath click event, then
this.zone.run(() => {
// update data here
});