I have a table in HTML.
The rows are counted (via use of $index), and only certain rows are shown (via use of ng-show).
Problem: $index does not return the right count. The table's count should go like "1,2,3...", but it does not.
<tbody>
<tr ng-repeat="fruit in basket" ng-show="fruit.isJuicy == type">
<td>{{$index + 1}}</td>
<td>{{fruit.Name}}</td>
</tr>
</tbody>
Here's the JSFiddle; don't forget to click on the buttons to see the issue: http://jsfiddle.net/f6HCX/2/
What is causing this counting problem? How can it be solved?
(Could you please also comment/rate my question's description clarity, (was it easily understood?) cheers!)
Edit: This question has been answered. More info with using filters: How to use parameters within the filter in AngularJS?