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.

    Install

    npm i angular-local-db

    DownloadsWeekly Downloads

    4

    Version

    0.1.3

    License

    MIT

    Last publish

    Collaborators

    • njgerner