jeudi 18 septembre 2014

Delete Record in angularjs


Vote count:

0




I am trying to delete a record both from scope and DB in angularjs but I am getting error. Although my record is deleting but not deleting in scope and shows error.



Uncaught TypeError: Cannot read property 'charAt' of undefined


Here is my code.



<a ng-click="deleteUser(user.id)">Delete</a>

$scope.deleteUser = function (uid) {
if(confirm("Are you sure to delete this?")){
$http.post("functions.php?type=deleteUser&uid="+uid).success(function(data){
$scope.users.splice(uid, 1);
});
}
};


asked 1 min ago







Delete Record in angularjs

Aucun commentaire:

Enregistrer un commentaire