How do I delete an item or object from an array using ng-click?

I am trying to write a function that enables me to remove an item when the button is clicked but I think I am getting confused with the function – do I use $digest?

HTML & app.js:

<ul ng-repeat="bday in bdays">
    <span ng-hide="editing" ng-click="editing = true">{{}} | {{}}</span>
    <form ng-show="editing" ng-submit="editing = false">
      <input type="text" ng-model="" placeholder="Name" ng-required/>
      <input type="date" ng-model="" placeholder="Date" ng-required/>
      <button class="btn" type="submit">Save</button>
      <a class="btn" ng-click="remove()">Delete</a>

$scope.remove = function(){
  $scope.newBirthday = $scope.$digest();


To remove item you need to remove it from array and can pass bday item to your remove function in markup. Then in controller look up the index of item and remove from array

<a class="btn" ng-click="remove(item)">Delete</a>

Then in controller:

$scope.remove = function(item) { 
  var index = $scope.bdays.indexOf(item);
  $scope.bdays.splice(index, 1);     

Angular will automatically detect the change to the bdays array and do the update of ng-repeat


EDIT: If doing live updates with server would use a service you create using $resource to manage the array updates at same time it updates server