gauravgango / gaurav-angular-indexeddb

An indexedDB wrapper for Angular JS.
http://gauravgango.github.io/gaurav-angular-indexeddb/
MIT License
9 stars 1 forks source link

Angular-IndexedDB

An indexedDB wrapper for Angular JS.

[Bower]() [Angular JS compatibility]() Dependency Status devDependency Status

Installation

# Install via bower
bower install angularjs-indexeddb

# Install via npm
npm install git://github.com/gauravgango/gaurav-angular-indexeddb.git

Basic Usage

Add angular-indexeddb.min.js library to your project's index.html

<script src="https://github.com/gauravgango/gaurav-angular-indexeddb/raw/master/js/angular-indexeddb.min.js" type="text/javascript">

Add indexed-db to you module dependency list


    angular.module('myApp',['indexed-db']);

In your module config function state your database name, version and table schema


    angular.module('myApp').config(function(indexeddbProvider){
        indexeddbProvider.setDbName('test'); // your database name
        indexeddbProvider.setDbVersion(1); // your database version
        indexeddbProvider.setDbTables(tables); //tables is array of objects contains your schema for various tables
    })

Documentation

You can find detailed documentation here

New to indexedDB ?

TODO

License

MIT License