[英]msSaveOrOpenBlob property doesn't exist on type Navigator angular 13
The property msSaveOrOpenBlob doesn't exist on type Navigator after updating to the angular 13.更新到 angular 13 后,类型 Navigator 上不存在属性 msSaveOrOpenBlob。
I know the Navigator.msSaveOrOpenBlob
is being deprecated as per https://developer.mozilla.org/en-US/docs/Web/API/Navigator/msSaveOrOpenBlob#browser_compatibility我知道Navigator.msSaveOrOpenBlob
根据https://developer.mozilla.org/en-US/docs/Web/API/Navigator/msSaveOrOpenBlob#browser_compatibility被弃用
I had an angular 12 application, now I am migrating to angular 13 and typescript have been updated to the latest version, but facing the issue of The property msSaveOrOpenBlob doesn't exist on type Navigator
我有一个 angular 12 应用程序,现在我正在迁移到 angular 13 和 typescript 已更新到最新版本,但面临The property msSaveOrOpenBlob doesn't exist on type Navigator
的问题
what will be the alternate code for the below下面的替代代码是什么
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveOrOpenBlob(blob, filename);
}
let newVariable: any = window.navigator;
var newBlob = new Blob([res.body], { type: "application/csv" });
if (newVariable && newVariable.msSaveOrOpenBlob) {
newVariable.msSaveOrOpenBlob(newBlob);
return;
}
Found some of the references找到了一些参考资料
https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1029 https://github.com/microsoft/TypeScript/issues/45612 https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1029 https://github.com/microsoft/TypeScript/issues/45612
Use the declaration merging and declare the types locally in your project work.使用声明合并并在您的项目工作中本地声明类型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.