我无法将断点放在正确的位置,因为它似乎在浏览器中显示了较旧版本的源代码。
如何在浏览器中强制更新源代码?
发布于 2018-08-09 02:43:20
解决了。它似乎是由装饰者占用多行造成的,就像这样:
@IonicPage({
name: 'my-page',
segment: 'my-page/:id',
defaultHistory: ['my-other-page']
})
@Component({
selector: 'my-page',
templateUrl: 'my-page-cotacao.html',
providers: [BrMaskerIonic3]
})
解决方案是在一行中设置每个装饰器,如下所示:
@IonicPage({ name: 'my-page', segment: 'my-page/:id', defaultHistory: ['my-other-page'] })
@Component({ selector: 'my-page', templateUrl: 'my-page.html', providers: [BrMaskerIonic3] })
发布于 2018-08-02 00:55:25
在开发过程中,最好利用chrome devtools >应用程序标签>服务工作者部分。基本上,您可以设置“绕过”服务工作者缓存和其他设置,以帮助您使用最新版本:
另一种方法是将您的缓存策略从默认策略修改为“网络优先”:
在您的服务人员中,请执行以下操作:
// dynamically cache any other local assets
self.toolbox.router.any('/*', self.toolbox.networkFirst);
// for any other requests go to the network, cache,
// and then only use that cached resource if your user goes offline
self.toolbox.router.default = self.toolbox.networkFirst;
https://stackoverflow.com/questions/51633472
复制相似问题