/ng-pouchdb-collection

pouchDB collection module for angular.

Primary LanguageJavaScript

ng-pouchdb-collection

Pouchdb collection module for angular. Using the "one db per user" methodology, plugin takes in the user db and a collection name. Create a view for that collection, all dual bindings included for angular views, no need to call $scope.apply()

Special Thanks to @danielzen for his starter codebase

Setup

Requirements

Setup ng-pouchdb-collection

TODO: add bower and node

API

.controller('TodoCtrl', function(pouchCollection)
  $scope.tasks = pouchCollection("user-db-test", "collecton2");

Add to Collection

$scope.tasks.$add({title: res, completed: false});

Update item in Collection

$scope.tasks.$update(task);

Remove from Collection

$scope.tasks.$remove(task);

testing

See demo folder with sample ionic project

License

Released under the MIT License.