本文整理汇总了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']);
}