本文整理匯總了TypeScript中application-settings.clear函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript clear函數的具體用法?TypeScript clear怎麽用?TypeScript clear使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了clear函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
export var testClear = function () {
// >> application-settings-clear
appSettings.clear();
// << application-settings-clear
TKUnit.assert(!appSettings.hasKey(boolKey), "Failed to remove key: " + boolKey);
TKUnit.assert(!appSettings.hasKey(stringKey), "Failed to remove key: " + stringKey);
TKUnit.assert(!appSettings.hasKey(numberKey), "Failed to remove key: " + numberKey);
};
示例2: onClearSettings
public onClearSettings() {
// >> app-settings-remove-key-code
appSettings.remove("isTurnedOn");
// << app-settings-remove-key-code
// >> app-settings-remove-all-code
appSettings.clear();
// << app-settings-remove-all-code
appSettings.setBoolean("isTurnedOn", false);
this.isTurnedOn = appSettings.getBoolean("isTurnedOn", false);
appSettings.setString("username", "Default name");
this.username = appSettings.getString("username");
appSettings.setNumber("locationX", 0.00);
this.locationX = parseFloat(appSettings.getNumber("locationX").toFixed(2));
this.someKey = appSettings.getString("noSuchKey", "No string value");
this.noBoolKey = appSettings.hasKey("noBoolKey");
}
示例3: logout
logout(){
clear();
this._routerExtensions.navigate(["/login"], { clearHistory: true });
}