mirror of
https://github.com/mempool/mempool.git
synced 2025-01-07 14:09:16 +01:00
24 lines
411 B
TypeScript
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);
|
|
}
|
|
}
|
|
}
|