angular-local-db

0.1.3 • Public • Published

angular-local-db

An AngularJS module that that provides a simple key-value browser based database API. This module utilizes the browers local storage to provide for each caching and robust offline access to stored data.

Features

  • init
  • get
  • set
  • clear
  • getIndex
  • setIndex
  • clearIndex
  • addToSet
  • clearFromSet
  • addToIndexList
  • clearFromIndexList
  • addToIndexSet
  • clearFromIndexSet
  • getSecondaryIndex
  • setSecondaryIndex
  • clearSecondaryIndex
  • addToSecondaryIndexList
  • clearFromSecondaryIndexList
  • addToSecondaryIndexSet
  • clearFromSecondaryIndexSet

Install

Bower

bower install angular-local-db --save

NPM

npm install angular-local-db --save

Usage

Require angular-local-db

angular.module('app', [
    'angular-local-db'
]).controller('Ctrl', function(
    $scope,
    $localDb
){});

Methods

init(options)

Initializes the localDb instance namespace. This is useful to allow for caching of many users data on the same browser.

$localDb.init({namespace: User.id})

get(key)

Gets the stored value for the assigned key.

let myValue = $localDb.get(myKey)

Todos

  • ngdoc Documentation
  • Unit Tests
  • Gulp Tasks

Any contribution will be appreciated.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.3
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.3
    2
  • 0.1.2
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i angular-local-db

Weekly Downloads

2

Version

0.1.3

License

MIT

Last publish

Collaborators

  • njgerner