I would like to to ng-repeat on this json (entries):
[{
"Entry": {
"id": "1",
"title": "Test",
"person": "Test",
"description": "Test",
"created": "2017-07-11 20:19:55",
"modified": "2017-07-11 20:19:55",
"date_finished": "2017-07-11 20:19:00",
"finished": false
}
}, {
"Entry": {
"id": "2",
"title": "Test 1",
"person": "Test 1",
"description": "Test 1",
"created": "2017-07-11 20:23:02",
"modified": "2017-07-11 20:23:02",
"date_finished": "2017-07-11 20:22:00",
"finished": false
}
}, {
"Entry": {
"id": "3",
"title": "Test 2",
"person": "Test 2",
"description": "Test 2",
"created": "2017-07-11 20:23:13",
"modified": "2017-07-11 20:23:13",
"date_finished": "2017-07-11 20:23:00",
"finished": false
}
}]
This is how I get the data:
public function index() {
$this->Entry->recursive = 0;
$this->set('entries', $this->Paginator->paginate());
$this->set('_serialize', 'entries');
}
This is my display code:
<table class="table">
<thead>
<tr>
<th>Title</th>
<th>Person</th>
<th>Description</th>
<th>Finished Date</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="entry in entries">
<td>{{ entry.title }}</td>
<td>{{ entry.person }}</td>
<td>{{ entry.description }}</td>
<td>{{ entry.date_finished }}</td>
</tr>
</tbody>
</table>
But there is no output, all the values are empty.
Is the json format ok? Any suggestion would be very helpful.