mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Updated snippets for local settings
This commit is contained in:
@@ -15,7 +15,7 @@ var noNumberKey: string = "noNumberKey";
|
|||||||
|
|
||||||
// <snippet name="local-settings">
|
// <snippet name="local-settings">
|
||||||
// ## Working with string, number and boolean values
|
// ## Working with string, number and boolean values
|
||||||
// </snippet
|
// </snippet>
|
||||||
|
|
||||||
export var testBoolean = function () {
|
export var testBoolean = function () {
|
||||||
LocalSettings.setBoolean(boolKey, false);
|
LocalSettings.setBoolean(boolKey, false);
|
||||||
@@ -23,7 +23,7 @@ export var testBoolean = function () {
|
|||||||
TKUnit.assert(false == boolValue, "Cannot set boolean to false, currently it is: " + LocalSettings.getBoolean(boolKey));
|
TKUnit.assert(false == boolValue, "Cannot set boolean to false, currently it is: " + LocalSettings.getBoolean(boolKey));
|
||||||
|
|
||||||
// <snippet name="local-settings">
|
// <snippet name="local-settings">
|
||||||
// ### set and get boolean value and provide default value in case it is not set
|
// ### Set and get boolean value and provide default value in case it is not set
|
||||||
// ``` JavaScript
|
// ``` JavaScript
|
||||||
LocalSettings.setBoolean("boolKey", true);
|
LocalSettings.setBoolean("boolKey", true);
|
||||||
var boolValue = LocalSettings.getBoolean("boolKey", false);
|
var boolValue = LocalSettings.getBoolean("boolKey", false);
|
||||||
@@ -36,7 +36,7 @@ export var testBoolean = function () {
|
|||||||
|
|
||||||
export var testString = function () {
|
export var testString = function () {
|
||||||
// <snippet name="local-settings">
|
// <snippet name="local-settings">
|
||||||
// ### set and get string value
|
// ### Set and get string value
|
||||||
// ``` JavaScript
|
// ``` JavaScript
|
||||||
LocalSettings.setString("stringKey", "String value");
|
LocalSettings.setString("stringKey", "String value");
|
||||||
var stringValue = LocalSettings.getString("stringKey");
|
var stringValue = LocalSettings.getString("stringKey");
|
||||||
@@ -82,7 +82,7 @@ export var testDefaults = function () {
|
|||||||
|
|
||||||
// <snippet name="local-settings">
|
// <snippet name="local-settings">
|
||||||
// ## Other functions
|
// ## Other functions
|
||||||
// </snippet
|
// </snippet>
|
||||||
|
|
||||||
export var testHasKey = function () {
|
export var testHasKey = function () {
|
||||||
// <snippet name="local-settings">
|
// <snippet name="local-settings">
|
||||||
|
|||||||
Reference in New Issue
Block a user