离子2直到点击才清爽

时间:2017-09-14 10:43:16

标签: angular typescript view ionic2 ionic3

有时当我动态加载列表或只绑定某些值时,屏幕上的视图不会刷新,直到我点击屏幕。

例如: 当应用程序启动时,朋友列表将在后台加载。屏幕保持空白,直到我点击屏幕上的任何位置,然后数据立即出现(之前已经加载,但只是未显示)。 Popover也是如此,我有箭头键来改变Popover的内容。每当我点击箭头键时,没有任何事情发生,直到一段时间(如1分钟)过去,或者我点击屏幕上的某个地方。

呈现价值:

<ion-title>{{groups[currentId].location}} ({{currentId+1}}/{{groups.length}}</ion-title>

OnClick(左图相同):

<ion-col><button ion-button full icon-only [disabled]="currentId===(groups.length-1)" (click)="onRight()">Next</button></ion-col>

onRight代码

onRight(){
    if(this.currentId < this.groups.length-1)
      this.currentId+=1;
}

离子标题不刷新,直到我按下“更多”按钮(除了导航到另一页之外没有任何其他功能)。

这是一个已知的问题/是否有解决方案?

编辑:ngZone解决了这个问题。感谢

onRight(){
  this.ngZone.run(() => {
    if(this.currentId < this.groups.length-1)
       this.currentId+=1;
  })
}

0 个答案:

没有答案
相关问题