CornerCouch
CornerCouch copied to clipboard
Get database automatically
Hello,
thank you very much. CornerCouch makes it very easy to access CouchDB from AngularJS. However, I have a question regarding $scope.server.getDB('dbname'): I'm using it within a CouchApp. I would guess that I can skip mentioning the dbname explicitly, as I want to use the same database which servers the CouchApp. Do I have to parse the URL by hand to avoid mentioning the dbname explicitly in the App?
Any hints would be appreciated.
Sven
This is the approach I'd take. I'd be happy to accept a pull request when you work out the detail:
CouchServer.prototype.getDB = function(dbName) {
if (!dbName) {
// do some parsing on location and set dbName
}
return new CouchDB(dbName, this.uri, this.method);
};
Cheers,
Jochen
Where I have to add this definition? I always get error that CouchServer is not defined.
It is part of the CornerCouch code.