【发布时间】:2018-05-11 16:57:56
【问题描述】:
我尝试了下面的代码来获取 indexedDb 配额存储信息
navigator.webkitTemporaryStorage.queryUsageAndQuota (
function(usedBytes, grantedBytes) {
console.log('we are using ', usedBytes, ' of ', grantedBytes, 'bytes');
},
function(e) { console.log('Error', e); }
);
它不工作并给出以下错误。
“Navigator”类型上不存在属性“webkitTemporaryStorage”。
谁能提供在 typescript 中获取 indexedDb 配额存储信息的解决方案?
【问题讨论】:
-
您的代码正在运行!我将其复制并粘贴到浏览器控制台中。您收到的错误信息是什么?
-
我没有得到。我在 typescript 中使用了这个代码并得到错误 Property 'webkitTemporaryStorage' does not exist on type 'Navigator'
-
这是一个与 typeScript 中的类型有关的问题
标签: angular typescript indexeddb