首页 > 解决方案 > Ionic 3 how to implement application user settings and store them

问题描述

I tried looking for a tutorial on this, but I didn't really find one that was helpful.

I have an Ionic 3 application, and I want to have some user settings for various little small things, that should be accessible from any part of the application (and any part of the code). These settings would also have to be stored on the device, so they should be saved somewhere.

How can I achieve this with Ionic 3? Do I need to have a "provider" for this, and import that provider into all of my pages, and have a 'getSetting' and 'setSetting' that's accessible through this provider?

Or is there a special way to actually handle this?

标签: angularionic-frameworkmobileionic3

解决方案


看看离子存储。这样就可以将变量或类似 json 的内容保存到设备的本地存储中。

您不必使用其他提供程序,因为您可以只导入 Ionic Storage 之一。


推荐阅读