I am trying to get sync() working between pouchDB and a local couchDB, within an Angular app (using angular-pouchdb).
this.system = pouchDB('system');
var remoteSystem = pouchDB('http://localhost:5984/system');
this.system.sync(remoteSystem, {live : true}).on('change', function (change) {
// yo, something changed!
console.log('changed');
}).on('error', function (err) {
// yo, we got an error!
console.log('error');
});
but I keep getting the following error:
Uncaught TypeError: undefined is not a function (angular.js:4146)
If I remove the .on chains the error goes away (but the sync still doesn't work)