Skip to content

gauravgango/gaurav-angular-indexeddb

Repository files navigation

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="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

  • Add example/demo with some basic database operations
  • Update wiki with recent changes

License

MIT License