當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript application-settings.remove函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。