本文整理汇总了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 });
}