Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Injectable,Inject } from '@angular/core';
- import { LOCAL_STORAGE, StorageService } from 'ngx-webstorage-service';
- const STORAGE_KEY = 'username';
- @Injectable()
- export class LocalStorageService {
- anotherTodolist = [];
- constructor(@Inject(LOCAL_STORAGE) private storage:
- StorageService) { }
- public storeOnLocalStorage(theCif: string): void {
- this.storage.set(STORAGE_KEY, theCif);
- console.log(this.storage.get(STORAGE_KEY));
- }
- public removeOnLocalStorage(){
- this.storage.clear();
- }
- public getOnLocalStorage(){
- return this.storage.get(STORAGE_KEY);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement