How to Delete an Item From a List in AngularJS

by Jason Swett,

I had a real bear of a time figuring out how to remove an item from a list in AngularJS. I found the solution in this Stack Overflow answer which I’m simply stealing and pasting here on my blog:

$scope.flumps.splice($scope.flumps.indexOf($scope.flump), 1);

So I guess you just have to do it with plain old JavaScript.

If you’re interested in seeing how you might update the server side as well, here’s an example for that:

Flump.delete({ id: $ }, function() {
  $scope.flumps.splice($scope.flumps.indexOf($scope.flump), 1);


Leave a Reply

Your email address will not be published. Required fields are marked *