1.1.5 • Published 5 years ago

ng-storages v1.1.5

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

ng-storages

Tested for angular5

Installation

npm install ng-storages

How to use

import { LocalStorageService } from 'ng-storages';
@NgModule({
    providers: [ LocalStorageService ]
})

LocalStorage

import { LocalStorageService } from 'ng-storages';

export class AComponent {
    constructor(protected storage: LocalStorageService){

        this.storage.set({key: value}).then((res) => {
            console.log(res);
        });

        this.storage.get('key').then((res) => {
            console.log(res);
        });

        this.storage.setObject({key: object}).then((res) => {
            console.log(res);
        });

        this.storage.getObject('key').then((res) => {
            console.log(res);
        });

        /**
         * remove specific key
         */
        this.storage.delete('key').then((res) => {
            console.log(res);
        });

        /**
         * clear all storage
         */
        this.storage.clear().then((res) => {
            console.log(res);
        });
    }
}

Cookie

import { CookieService } from 'ng-storages';
@NgModule({
  providers: [ CookieService ]
})
import { CookieService } from 'ng-storages';
1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago