Revision 58989
Added by Konstantinos Triantafyllou almost 4 years ago
localStorage.service.ts | ||
---|---|---|
11 | 11 |
|
12 | 12 |
constructor(@Inject(PLATFORM_ID) private platformId: string) { |
13 | 13 |
if(isPlatformBrowser(this.platformId)) { |
14 |
let item = localStorage.getItem('communityDirectLink');
|
|
14 |
let item = localStorage.getItem('directLink');
|
|
15 | 15 |
if(item !== null) { |
16 | 16 |
this.communityDirectLink = new BehaviorSubject<boolean>(item == 'true'); |
17 | 17 |
} else { |
... | ... | |
22 | 22 |
|
23 | 23 |
public setCommunityDirectLink(value: string) { |
24 | 24 |
this.communityDirectLink.next(Boolean(value).valueOf()); |
25 |
localStorage.setItem('directLink', value); |
|
25 | 26 |
} |
26 | 27 |
|
27 | 28 |
public get(): Observable<boolean> { |
Also available in: Unified diff
[Library | Trunk]: Add setItem to localStorage for directLink.