Remove item from array by pressing button
<p>I'm using angularJS to build a SPA. I am trying to delete an object from an array in my controller. I am using ng-repeat and can't seem to get my head around this. Here is the related html:</p>

<pre><code>&lt;div class="cat-button" ng-repeat="category in cats" category="category"&gt;
         &lt;button class=" close-button" ng-click="removeCat()"&gt;
         &lt;span class="glyphicon glyphicon-remove-sign" aria-hidden=true&gt; &lt;/span&gt; &lt;/button&gt;{{category.name}}
&lt;/div&gt;
</code></pre>

<p>This created a div with a button for every object that gets saved to my <code>$scope.cats</code> array. It works fine but I cant figure out how do I use the button in each div to delete that specific object.</p>

<p>When I click on the button , the function on my controller gets called, but this is where I get lost, how do I delete the specific object created dynamically by the user. </p>

<p>This is the related code on my controller:</p>

<pre><code> //Function to delete category

$scope.removeCat = function () {

   //I know I have to use splice on my array but how do I Identify the object that needs to be deleted from my array?



};
</code></pre>