本文整理匯總了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();
});