【问题标题】:NativeScript - how to view the contents of the app settings while debugging?NativeScript - 如何在调试时查看应用程序设置的内容?
【发布时间】:2020-06-21 07:46:00
【问题描述】:

我正在使用 NativeScript 6+ 和 Angular 8+ 编写应用程序。

我将需要使用一些客户端存储来保存一些数据,以便在用户每次使用应用程序时都会保留。

我在这里读到过:

https://docs.nativescript.org/ns-framework-modules/application-settings

https://www.nativescript.org/blog/client-side-storage-in-nativescript-applications

我将使用“应用设置”。

在开发和调试时,我希望能够查看和编辑应用设置的内容。我该怎么做?

【问题讨论】:

  • 你可以在任何你喜欢的地方打印它们(或放置一个断点)(例如console.log(getBoolean("isTurnedOn"))

标签: angular local-storage nativescript storage


【解决方案1】:

没有直接的方法可以查看所有这些键。您可以在application-settings 模块上使用getAllKeys() 方法来获取所有活动键,然后获取每个键的值,如果需要,在调试时记录它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-16
    • 2010-12-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多