本文整理汇总了TypeScript中application-settings.remove函数的典型用法代码示例。如果您正苦于以下问题:TypeScript remove函数的具体用法?TypeScript remove怎么用?TypeScript remove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: logout
logout(){
appSettings.remove("token");
appSettings.remove("id");
appSettings.remove("username");
//Redirect to login
this.router.navigate(['/login']);
}
开发者ID:nestor94,项目名称:my-instagram,代码行数:7,代码来源:user.services.ts
示例2: function
export var testRemove = function () {
// >> application-settings-removekey
appSettings.remove("boolKey");
// << application-settings-removekey
TKUnit.assert(!appSettings.hasKey(boolKey), "Failed to remove key: " + boolKey);
appSettings.remove(stringKey);
TKUnit.assert(!appSettings.hasKey(stringKey), "Failed to remove key: " + stringKey);
appSettings.remove(numberKey);
TKUnit.assert(!appSettings.hasKey(numberKey), "Failed to remove key: " + numberKey);
};
开发者ID:sitefinitysteve,项目名称:NativeScript,代码行数:12,代码来源:application-settings-tests.ts
示例3: remove
/**
* @method remove
* @param {string} key Storage key name
* @return {void}
* @description
* This method will remove a localStorage item from the client.
**/
remove(key: string): any {
if (AppSettings.hasKey(key)) {
AppSettings.remove(key);
} else {
console.log('Trying to remove unexisting key: ', key);
}
}
开发者ID:davexs2020,项目名称:issues-nativescript01,代码行数:14,代码来源:storage.native.ts
示例4: launchExample
public launchExample() {
if (hasKey("gotoexample")) {
let value = getString("gotoexample");
remove("gotoexample");
this.router.navigate([value]);
}
}
开发者ID:yirony199,项目名称:nativescript-sdk-examples-ng,代码行数:7,代码来源:app.component.ts
示例5: logout
logout(): Promise<boolean> {
console.log("LoginService.logout()");
this.username = undefined;
appSettings.remove(USER_KEY);
return Promise.resolve(true);
}
开发者ID:evenkeeler,项目名称:nativescript-angular,代码行数:7,代码来源:login-test.ts
示例6: removePostKey
private removePostKey(postKey:string) {
applicationSettings.remove(postKey);
let indexData:string = applicationSettings.getString(indexKey, "[]");
let index:Array<string> = JSON.parse(indexData);
let arrayIndex:number = index.indexOf(postKey, 0);
if (arrayIndex > -1) {
index.splice(arrayIndex, 1);
console.log("Removed " + postKey + " from index position " + arrayIndex);
}
applicationSettings.setString(indexKey, JSON.stringify(index));
console.log("Index length " + index.length);
}
开发者ID:wasabinza,项目名称:Wop2,代码行数:12,代码来源:main-view-model.ts
示例7: 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");
}
开发者ID:aymenbraiek,项目名称:nativescript-sdk-examples-ng,代码行数:21,代码来源:values.component.ts
示例8: logout
logout(){
appSettings.remove("token");
}
开发者ID:hellenfc,项目名称:my-instagram,代码行数:3,代码来源:user.services.ts
注:本文中的application-settings.remove函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论