- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我的 Angular 项目中,我有这种代码:
this.swUpdate.available.subscribe(() => {
...
});
它工作正常,但给了我关于 activated
被弃用的警告。
我应该怎么做才能修复此警告?
最佳答案
我相信 activated
和 activateUpdate()
是不同的东西。您调用 activateUpdate()
,然后当它完成时,activated
发生。
此外,activated
和available
绝对是不同的东西(你的问题都提到了)。 available
表示检测到更新; activated
表示已经安装。
根据文档(https://angular.io/api/service-worker/SwUpdate),available
的替换是:
import {filter, map} from 'rxjs/operators';
// ...
const updatesAvailable = swUpdate.versionUpdates.pipe(
filter((evt): evt is VersionReadyEvent => evt.type === 'VERSION_READY'),
map(evt => ({
type: 'UPDATE_AVAILABLE',
current: evt.currentVersion,
available: evt.latestVersion,
})));
关于Angular SwUpdate 激活 deprication,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70684682/
现在我知道有一百万篇关于没有提供商提供这样那样服务的帖子,我知道它需要进入提供商请阅读我的整个帖子。 基本上,我正在尝试使用 SwUpdate 检查是否有更新,如果有,请刷新浏览器: import {
在我的 Angular 项目中,我有这种代码: this.swUpdate.available.subscribe(() => { ... }); 它工作正常,但给了我关于 activated 被
我很难将 angulars service worker 集成到我的应用程序中。我按照指南进行操作,到目前为止它一直有效。我可以在我的主屏幕上创建一个快捷方式并启动到我的应用程序中。问题是我的应用程序
我目前正在使用层meta-azure-device-update 和meta-swupdate 进行Azure 设备更新。我想运行安装后脚本。我关注了下面提到的来源: 1.sw-描述.rst http
我正在使用 Angular5 和 angular service worker。 我缓存一些数据和一些 Assets ,一切都按预期正常工作,甚至部署了代码。 现在,如果我更新一些代码并再次部署,se
我是一名优秀的程序员,十分优秀!