3.0.2 • Published 5 years ago
angular-2-local-storage v3.0.2
angular-2-local-storage
LocalStorageService for Angular with mostly the same API (and most of the code) from angular-local-storage.
AoT compatible.
Differences
- No events broadcast on $rootScope - LocalStorageService exposes observables for
errors$
,removeItems$
,setItems$
andwarning$
if you really need something to happen when something happens. - The
bind
function doesn't work anymore (there is a stub so this can still be a drop-in, but it'll do nothing).
Install
npm install angular-2-local-storage
Usage
You can optionally configure the module:
import { LocalStorageModule } from 'angular-2-local-storage';
@NgModule({
imports: [
LocalStorageModule.forRoot({
prefix: 'my-app',
storageType: 'localStorage'
})
],
declarations: [
..
],
providers: [
..
],
bootstrap: [AppComponent]
})
export class AppModule { }
Then you can use it in a component:
import { LocalStorageService } from 'angular-2-local-storage';
@Component({
// ...
})
export class SomeComponent {
constructor (
private _localStorageService: LocalStorageService
) {
// YAY!
}
}
Configuration options
import { ILocalStorageServiceConfig } from 'angular-2-local-storage';
for type information about the configuration object.
3.0.2
5 years ago
3.0.1
5 years ago
3.0.0
5 years ago
2.0.1
5 years ago
2.0.0
6 years ago
1.0.2
6 years ago
1.0.1
7 years ago
1.0.0
7 years ago
0.1.0
7 years ago
0.1.0-beta.0
7 years ago
0.0.25
7 years ago
0.0.24
7 years ago
0.0.23
7 years ago
0.0.22
7 years ago
0.0.21
7 years ago
0.0.20
8 years ago
0.0.19
8 years ago
0.0.18
8 years ago
0.0.17
8 years ago
0.0.16
8 years ago
0.0.15
8 years ago
0.0.14
8 years ago
0.0.13
8 years ago
0.0.12
8 years ago
0.0.5
8 years ago
0.0.4
8 years ago
0.0.3
8 years ago
0.0.2
8 years ago
0.0.1
8 years ago