Angular decorators and services for automatically saving and restoring component properties to HTML5 LocalStorage and SessionStorage with expiration support. v21.0.0 (latest stable) supports Angular 15+ and is actively maintained with monthly releases. Key differentiators: simple @LocalStorage() and @SessionStorage() decorators, configurable expiration times (seconds to years), and service APIs for manual control. Unlike ngx-webstorage, it offers built-in expiration and type-safe decorators.
npm install angular-web-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup: import AngularWebStorageModule, use @LocalStorage decorator with optional key, expiration (7 days).
Update to angular-web-storage@21 for Angular 15+ compatibility.
Use set(key, value, { expired: 10, unit: 'h' }) pattern.Use LocalStorageService.set() for runtime updates.
Always handle null returns from get() as expired.
Choose one pattern per key.
Add AngularWebStorageModule to imports array in @NgModule.
Wrap calls in isPlatformBrowser() check from @angular/common.
Update to v21: npm install angular-web-storage@latest.