title: How do I delete an item or object from an array using ng-click?
body: <p>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 <code>$digest</code>?</p>
  
  <p>HTML &amp; app.js:</p>
  
  <pre><code>&lt;ul ng-repeat="bday in bdays"&gt;
    &lt;li&gt;
      &lt;span ng-hide="editing" ng-click="editing = true"&gt;{{bday.name}} | {{bday.date}}&lt;/span&gt;
      &lt;form ng-show="editing" ng-submit="editing = false"&gt;
        &lt;label&gt;Name:&lt;/label&gt;
        &lt;input type="text" ng-model="bday.name" placeholder="Name" ng-required/&gt;
        &lt;label&gt;Date:&lt;/label&gt;
        &lt;input type="date" ng-model="bday.date" placeholder="Date" ng-required/&gt;
        &lt;br/&gt;
        &lt;button class="btn" type="submit"&gt;Save&lt;/button&gt;
        &lt;a class="btn" ng-click="remove()"&gt;Delete&lt;/a&gt;
      &lt;/form&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  
  $scope.remove = function(){
    $scope.newBirthday = $scope.$digest();
  };
  </code></pre>