I have a simple table which displays data objects, with one of the properties of the data objects being numbers.
Here's my table with ngRepeat:
<tbody>
<tr ng-repeat="number in Numbers">
<td>{{ $index }}</td>
<td>{{ number.num }}</td>
</tr>
</tbody>
Now what i'd like to do is add a column that calculates and displays the percent difference between the first and preceding numbers. Is there any way to do this with ngRepeat? I tried adding a column like this:
<td>{{ number.num[$index] / number.num[$index + 1] }}</td>
But in the end it didn't work. It ended up displaying all the data in that column as NaNs. Am I missing something here?