I have an array of objects like this one:
$scope.sales = [
{id: 15, location:'neverland'},
{id: 16, location:'farawayland'},
{id: 17, location:'highland'}
];
This array I am trying to display in a table, it should look like this:
id | location
15 | neverland
16 | farawayland
17 | highland
My html :
<input type="text" ng-model="sales[0].id">
<table class="table table-hover">
<tr ng-repeat="x in sales">
<td>{{x.id}}</td>
<td>{{x.location}}</td>
</tr>
</table>
The input field with value 15 gets printed. It works if I also ask the 2nd or 3rd value. But the table consists of 3 empty rows.
If I add an index (even <td>{{x[0].id}}</td>
), I get a server error.