【发布时间】:2019-04-03 11:34:19
【问题描述】:
Angular documentation 提供以下示例来激活软件更新:
constructor(updates: SwUpdate) {
updates.available.subscribe(event => {
if (promptUser(event)) {
updates.activateUpdate().then(() => document.location.reload());
}
});
}
据我观察,调用本身不足以激活新版本,需要重新加载。但是,即使没有 activateUpdate() 调用,document.location.reload() 也足够了。
activateUpdate() 调用的目的是什么?为什么在 reload 足够的时候调用它?
【问题讨论】:
-
你找到答案了吗?
标签: angular service-worker progressive-web-apps