首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >离子4侧菜单不更新其内容

离子4侧菜单不更新其内容
EN

Stack Overflow用户
提问于 2019-11-11 13:25:48
回答 1查看 216关注 0票数 1

我已经创建了一个离子4应用程序。

  • 我正在使用本地谷歌地图和自定义标记。
  • 当我点击一个标记时,我想打开边菜单上的位置详细信息.

我所做的,

代码语言:javascript
复制
- 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

问题:-

  • 我的边菜单不更新它的内容当我点击标记
  • 当我在选项卡之间切换时更新,我想当刷新选项卡

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-11-11 13:55:12

“业务”变量的数据更新了吗?如果是这样,也许您可以尝试在ngzone中运行赋值代码。

代码语言:javascript
复制
// 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
}); 
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58802281

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档