From 848f9748242dfe4c159455406521aa30fa9181b2 Mon Sep 17 00:00:00 2001 From: Sebastian Leidig Date: Fri, 18 Sep 2015 20:02:54 +0200 Subject: [PATCH] added replication (sync) with localhost couchdb --- app/model/child.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/model/child.js b/app/model/child.js index 4adfcb3..09d70fc 100644 --- a/app/model/child.js +++ b/app/model/child.js @@ -39,6 +39,11 @@ angular.module('myApp.child', [ .factory('childrenManager', ['pouchDB', '$q', 'Child', function (pouchDB, $q, Child) { var db = pouchDB('hdb'); + var rep = db.replicate.sync('http://localhost:5984/hdb', { + live: true, + retry: true + }); + var childrenManager = { _pool: {}, @@ -88,7 +93,6 @@ angular.module('myApp.child', [ db.allDocs({include_docs: true, descending: true}) .then(function (dataArray) { var items = []; - console.log(dataArray); dataArray.rows.forEach(function (row) { var data = row.doc; var o = scope._retrieveInstance(data._id, data);