【问题标题】:Ionic Native Storage - Get Specific Key Values In a Single PromiseIonic Native Storage - 在单个 Promise 中获取特定的键值
【发布时间】:2018-04-05 15:28:50
【问题描述】:

我正在使用 Ionic Native Storage:
https://ionicframework.com/docs/native/native-storage/

我将表单值保存为

密钥:form-xxxx-xxxx(某些 id 为 xxxx-xxxx)
值:一些对象

现在为了从 Native Storage 中获取项目,我将使用 Storage.getItem(Key)。现在这个方法返回一个获取每个项目的承诺。
我不想遍历键并为每个项目返回一个承诺,因为我需要显示一些列表(保存的表单列表)。如何通过返回一个承诺并获得我的价值观来实现它?

遗憾的是,没有这样的方法来获取密钥列表,给定一个用于本地存储的密钥数组 :(

谢谢。

【问题讨论】:

    标签: ionic-framework promise ionic-native cordova-nativestorage


    【解决方案1】:

    按照this web page 尝试Promise.all

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多