离子3:无法刷新视图

时间:2018-07-11 06:03:16

标签: ionic3 angular5 refresh page-refresh ionic-view

我有一个Ionic 3Angular 5项目。 更新完成后,页面不会自动刷新。

例如:如果我编辑任何页面的数据并保存,则数据将保存在数据库中。 现在,如果再次转到该页面,我的Web API将获取更新的数据,但ts组件仍显示已缓存/旧的数据。我还尝试在GET调用之前锁定模型,但是仍然显示旧数据。

我尝试使用zone.run和changedetector,但徒劳(如代码所示) 如果可以避免缓存或获取更新的数据,请帮帮我

this.zone.run(() => {
    this.protocols = response.protocols;
    this.ConfigureProtocol = response.ConfigureProtocol;
    this.changeDetectorRef.detectChanges();
});

0 个答案:

没有答案