I try to load a table in HTML from Ajax json, using Angular and ng-repeat. My problem is that the JSON is a bit complicated and I don't know how to access "informationstyp", which is what I want to display in the table. The root of the JSON ("values") is a list. Next level ("informationstyper") is also a list.
How can I get "informationstyp" into the table? What should I write instead of {{data.arendeslagId}} in my html?
What I want in my table is:
FK1002
FK1003
FK1004
Thank you for your help.
My html:
<table class="table table-hover">
<thead>
<tr>
<th>Arendeslagid</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in infotyper">
<td>{{data.arendeslagId}}</td>
</tr>
</tbody>
</table>
My JavaScript:
$scope.infotyper = "";
$scope.invoke = function() {
$.ajax({
"cache": false,
"async": true,
"crossDomain": true,
"url": url",
"method": "POST",
"headers": {
"cache-control": "no-cache",
},
success: function (response) {
$scope.infotyper= response;
}
});
};
My JSON-response:
