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


TypeScript LocalStorageService.clear方法代碼示例

本文整理匯總了TypeScript中ng2-webstorage.LocalStorageService.clear方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript LocalStorageService.clear方法的具體用法?TypeScript LocalStorageService.clear怎麽用?TypeScript LocalStorageService.clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ng2-webstorage.LocalStorageService的用法示例。


在下文中一共展示了LocalStorageService.clear方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: resolve

 handler: () => {
   this.storage.clear('profile');
   this.storage.clear('idToken');
   this.storage.clear('accessToken');
   this.storage.clear('refreshToken');
   this.appState.reset();
   resolve();
 }
開發者ID:IdleLands,項目名稱:Play,代碼行數:8,代碼來源:auth.service.ts

示例2:

        return this.http.post('api/logout', {}).map((response: Response) => {

            this.$localStorage.clear('authenticationToken');
            // to get a new csrf token call the api
            this.http.get('api/account').subscribe(() => {}, () => {});
            return response;
        });
開發者ID:JimSpriggs,項目名稱:sourdough,代碼行數:7,代碼來源:auth-session.service.ts

示例3: addNewMessage

  /**
   * Method to add new message to chat.
   *
   * Special cases for messages:
   *  Message   Action
   *  /quit     Quits from chat room and redirect to chat entry
   */
  public addNewMessage() {
    if (this.message === '/quit') {
      this.localStorage.clear('nick');

      this.router.navigateByUrl('/chat/entry');

      return;
    }

    this.messages.push({
      nick: this.nick,
      message: this.message,
      createdAt: firebase.database.ServerValue.TIMESTAMP,
    });

    this.message = '';
  }
開發者ID:tarlepp,項目名稱:Angular2-Firebase-Material-Demo,代碼行數:24,代碼來源:room.component.ts

示例4: Observable

 return new Observable((observer) => {
     this.$localStorage.clear('authenticationToken');
     this.$sessionStorage.clear('authenticationToken');
     observer.complete();
 });
開發者ID:alv-ch,項目名稱:job-room,代碼行數:5,代碼來源:auth-jwt.service.ts

示例5: Observable

 return new Observable(observer => {
     this.http.post('api/logout', {});
     this.$localStorage.clear('authenticationToken');
     observer.complete();
 });
開發者ID:baskeboler,項目名稱:generator-jhipster,代碼行數:5,代碼來源:_auth-oauth2.service.ts


注:本文中的ng2-webstorage.LocalStorageService.clear方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。