从mysql中删除 – angular度nodejs

我需要帮助来执行angular度删除和更新。 在nodejs是好的,在Firefox中testingrestApi

用于删除操作的angular度控制器的一部分

$scope.deleteCustomer = function (index) { var alert = confirm("Do you really want to delete the task?"); if (alert == true) { $http.post('/customers/', { customer: $scope.names[index] }) .then(function success(e) { $scope.errors = []; $scope.names.splice(index, 1); }, function error(e) { $scope.errors = e.data.errors; }); } }; 

Html代码:

  <td>{{customer.id}}</td> <td>{{customer.name}}</td> <td> <button ng-click="updateCustomer($index)" class="btn btn-primary btn-xs">Edit</button> <button ng-click="deleteCustomer($index)" class="btn btn-danger btn-xs">Delete</button> </td> </tr> 

有了这个代码,我可以删除一个行,但是如果我刷新页面的行不会从数据库中删除。