本文整理匯總了TypeScript中ng2-webstorage.LocalStorageService.store方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript LocalStorageService.store方法的具體用法?TypeScript LocalStorageService.store怎麽用?TypeScript LocalStorageService.store使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ng2-webstorage.LocalStorageService
的用法示例。
在下文中一共展示了LocalStorageService.store方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: reject
lock.getUserInfo(accessToken, (error, profile) => {
if(error) {
return reject(error);
}
this.storage.store('profile', profile);
this.storage.store('idToken', idToken);
this.storage.store('accessToken', accessToken);
this.storage.store('refreshToken', refreshToken);
resolve();
});
示例2: storeAuthenticationToken
storeAuthenticationToken(jwt, rememberMe) {
if (rememberMe) {
this.$localStorage.store('authenticationToken', jwt);
} else {
this.$sessionStorage.store('authenticationToken', jwt);
}
}
示例3: authSuccess
function authSuccess (resp) {
let response = resp.json();
let expiredAt = new Date();
expiredAt.setSeconds(expiredAt.getSeconds() + response.expires_in);
response.expires_at = expiredAt.getTime();
this.$localStorage.store('authenticationToken', response);
return response;
}
示例4: enterNick
/**
* Method to store nick to local storage and redirect user.
*
* @param {string} nick
*/
public enterNick(nick: string) {
this.localStorage.store('nick', nick);
this.router.navigate(['/chat']);
}