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


TypeScript LocalStorageService.set方法代碼示例

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


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

示例1:

					response => {
						var content = response.json().content,
							user = content[0];

						this.localStorageService.set("userFirstName", user.firstName);
						this.localStorageService.set("userSurname", user.surname);
						this.localStorageService.set("userId", user._id);
						this.localStorageService.set("userRole", user.role);

						window.location.href = '//' + window.location.host;
					});
開發者ID:gmiriam,項目名稱:frontend,代碼行數:11,代碼來源:landing.component.ts

示例2:

 return this.AuthService.refreshToken(user_name, access_token, refresh_token).map(response => {
     if (response) {
         this.localStorageService.set("accessToken", response.access_token);
         this.localStorageService.set("refreshToken", response.refresh_token);
         this.localStorageService.set("expiresTime", (Date.now() / 1000) + response.expires_in);
         console.log("refresh token");
         this.AuthService.checkRoleForRedirect(/*tempRoute*/);
         return true;
     } else {
         response => {
             console.log("Try to Login again");
         }
     }
 })
開發者ID:uopeydel,項目名稱:game_project,代碼行數:14,代碼來源:auth.guard.ts

示例3: setCurrentConnectionProfile

 setCurrentConnectionProfile(connectionProfile: string) {
     this.localStorageService.set('currentConnectionProfile', connectionProfile);
 }
開發者ID:GitWhiskey,項目名稱:composer,代碼行數:3,代碼來源:connectionprofile.service.ts

示例4: setItem

 setItem(key, value) {
   this.storage.set(key, value);
 }
開發者ID:Kwakhona,項目名稱:thinkvideo-ng2,代碼行數:3,代碼來源:storage.service.ts


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