Hey guys!
I'm pretty stuck at the moment and hope that I could get some help here.
I'm using coucDB to store data. I want to Delete documents by ID, but seems
like my code ain't working. I'm really stuck.
This is how I GET my datas, and it works:
http.get('http://127.0.0.1:5984/customers/_all_docs?include_docs=true').success(function
(data) {
scope.customerList = data.rows;
But now I want to be able to delete data by ID. In my html page it looks
like this:
<td><a ng-click="removeCustomer(_id, _rev)" class="btn btn-small
btn-danger" style="width:100px;">Delete {{customers.doc.company}}</a></td>
But my controller which looks like this doesn't work:
scope.removeCustomer = function (_id, _rev) {
http.delete('http://127.0.0.1:5984/customers/' +_id + '?rev=' +
_rev).then( alert ('Deleted!'));
};
It does alert the "Deleted", but it's not. When I fill out the ID+rev
manually like this: 'http://127.0.0.1:5984/customers/some_id?rev=some_rev'
it works and delete the document. So something is missing to identify the
ID + rev. How should I do this?
Thanks for reading.
Regards,
Mathias.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.