Hello. I've done that now, but still doesn't work. Should my delete form 
look different? Should I store my data somehow or anything?


Den torsdag den 15. maj 2014 14.09.19 UTC+2 skrev Filipe Monteiro:
>
> Your scope functions are inside of your http.get success. You should put 
> those functions out of this promise.
>
> Em quinta-feira, 15 de maio de 2014 08h45min59s UTC-3, Mathias Christensen 
> escreveu:
>>
>> Hello everyone! I'm using Couchdb to store my data. and createNewCustomer 
>> + the list of customers works fine. I need help to delete.
>>
>> This is my ng-click:
>>
>>
>>     ---->>        <td><a ng-click="remove(customers.id)" class="btn 
>> btn-small btn-danger" style="width:100px;">Delete 
>> {{customers.doc.company}}</a></td>
>>
>> I've tried a lot of stuff inside my controller, and this is what I got so 
>> far. This is both the listing and now I want to add the delete function 
>> inside same ctrl.:
>>
>>
>> var customerListApp = angular.module('customerListApp', []);
>>
>> customerListApp.controller('customerListCtrl', ['$scope', '$http',
>>     function (scope, http) {
>>
>>     http.get('
>> http://127.0.0.1:5984/customers/_all_docs?include_docs=true').success(function(data)
>>  {
>>         scope.customerList = data.rows;
>>
>>         scope.sortField = 'company';
>>         scope.reverse = true;
>>     });
>> ---------------vvvvvvvvvvvvvvvvvvv---------------------------
>>
>>         scope.remove = function (id) {
>>             for (i in customers) {
>>                 if (customers[i].id == id) {
>>                     customers.splice(i, 1);
>>                 }
>>             }
>>         }
>>
>>
>>
>>
>>     }]);
>>
>>
>>
>> It seems like nothing is happening when I click the button. Help! :)
>>
>

-- 
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.

Reply via email to