6.0.2 • Published 6 years ago

angular-web-store v6.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

angular-web-store

Installation

To install this library, run:

$ npm install angular-web-store --save

Quick Start

Import the AngularWebStoreModule in your module.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import your library
import { AngularWebStoreModule } from 'angular-web-store';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AngularWebStoreModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Usage

Using LocalStorageService or SessionStorageService service.

import { Component } from '@angular/core'
import { LocalStorageService, SessionStorageService } from 'angular-web-store'

@Component({
    selector: 'demo',
    templateUrl: './demo.component.html'
})
export class DemoComponent {

    constructor(
      private local: LocalStorageService, 
      private session: SessionStorageService
    ) { }

    KEY = 'value';
    value: any = null;

    set() {
        this.local.set(this.KEY, { a: 1, now: +new Date }, '4s')
    }

    remove() {
        this.local.remove(this.KEY)
    }

    get() {
        this.value = this.local.get(this.KEY)
    }

    clear() {
        this.local.clear()
    }
}


## License

MIT © [mizne](mailto:w20054319@126.com)
6.0.2

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.1.26

6 years ago

0.1.25

6 years ago

0.1.24

6 years ago

0.1.23

6 years ago

0.1.22

6 years ago

0.1.21

6 years ago

0.1.20

6 years ago

0.1.18

6 years ago

0.1.17

6 years ago

0.1.16

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.4

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago