angular-2-local-storage v3.0.2 provides a LocalStorageService for Angular 2+ with a familiar API derived from angular-local-storage. It is AoT compatible, offers observables (errors$, removeItems$, setItems$, warning$) for reactive monitoring, and supports configurable prefix and storage type. Unlike its predecessor, it drops $rootScope events and the bind function (stubbed). The package ships TypeScript types and has peer dependencies on Angular (>=6.0) and RxJS (>=6.0). It is actively maintained on GitHub by phenomnomnominal.
npm install angular-2-local-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows injection of LocalStorageService, setting and getting a value from localStorage.
Use observables (errors$, removeItems$, setItems$) instead of bind.
Update to Angular 6+.
Configure as shown in the README: LocalStorageModule.forRoot({ prefix: 'my-app', storageType: 'localStorage' }).Run: npm install angular-2-local-storage
Ensure the service is injected via constructor and use correct method names: set, get, remove, clear.