how to connect with couchDB by angular.js?

By : Ashvin

i search for this but not get proper answer weather we able to connect directly with couchDB with angular.js framework


we have to use node.js help for that.

By : Ashvin


I've modified the example on the AngularJS website to use CouchDB instead of mongolab. See the jsfiddle here and github repository here I'm an angular newbie: I found it a struggle to get my head round $resource, but it seems to work well.

$scope.projects = ProjectCouch.get({q:'_all_docs', include_docs: 'true', limit: 10});

angular.module('CouchDB', ['ngResource']).
    factory('ProjectCouch', function($resource) {
        var ProjectCouch = $resource(':protocol//:server/:db/:q/:r/:s/:t',
                                     {protocol: 'http:', server: 'localhost:5984', db:'projects'}, {update: {method:'PUT'}   

   ProjectCouch.prototype.update = function(cb) {
    return ProjectCouch.update({q: this._id},
        this, cb);

  ProjectCouch.prototype.destroy = function(cb) {
      return ProjectCouch.remove({q: this._id, rev: this._rev}, cb);

  return ProjectCouch;
By : Warwick

This video can help you solving your question :)
By: admin