本文整理汇总了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();
}
示例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;
});
示例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 = '';
}
示例4: Observable
return new Observable((observer) => {
this.$localStorage.clear('authenticationToken');
this.$sessionStorage.clear('authenticationToken');
observer.complete();
});
示例5: Observable
return new Observable(observer => {
this.http.post('api/logout', {});
this.$localStorage.clear('authenticationToken');
observer.complete();
});