I'm using angular-2-local-storage which has an observable of setItems$ that I'm trying to... Observe, with the following code in a directive:
/** app-theme.directive.ts **/
import { Directive, ElementRef, Input } from '@angular/core';
import { UserSettings } from './core/user-settings';
import { LocalStorageService } from 'angular-2-local-storage';
@Directive({
selector: '[appTheme]'
})
export class AppThemeDirective {
constructor(el: ElementRef, localStorageService: LocalStorageService) {
localStorageService.setItems$.subscribe(function(x: any) {
console.log('subscribed', x);
});
}
}
The local storage is updating and persisting well enough in my code, but the updates are not being observed and logging to the console. Any obvious gotcha I missed?