New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ng-simple-storage

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-simple-storage

Angular storage wrapper

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

ng-simpe-storage

This library is a simple wrapper on a localStorage

Installation

Run npm install --save ng-simple-storage

API reference for ng-simple-storage

import { StorageService } from 'ng-simple-storage

Services

StorageService

Properties

length: number - Currently storred items count

items: { key: value } - Currently storred items

onItemChange: Observable<StorageItemChangeEvent> - Observable which fires when item in storage changes

Methods

clear(): void - clear storage

getItem<Type>(key: string): Type - return item by key

removeItem<Type>(key: string): void - remove item by key

key(index: number): string - return the key of item at the specified index

setItem<Type>(key: string, value: Type): void - save item with a specified key

setStorage(storage: Storage): void - change storage used by the service

Aditional classes

StorageItemChangeEvent<T>

Properties

key: string - key of changed item

oldValue: T - value of item before event emitted

newValue: T - current value of item

Setting custom storage

You can provide your own implementation of storage by

{ provide: DEFAULT_STORAGE, useValue: CustomStorage }

CustomStorage must implement Storage interface

Keywords

angular

FAQs

Package last updated on 31 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts