mempool/frontend/src/app/services/storage.service.ts
2020-11-16 19:27:06 +07:00

24 lines
411 B
TypeScript

import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class StorageService {
getValue(key: string): string {
try {
return localStorage.getItem(key);
} catch (e) {
console.log(e);
return '';
}
}
setValue(key: string, value: any): void {
try {
localStorage.setItem(key, value);
} catch (e) {
console.log(e);
}
}
}