I have a table that is being printed in the incorrect order based on the JSON.
The table looks like below, i want it to be in the order of the JSON:
why does ng-repeat not print it as it finds it. This is being developed in the ServiceNow platform.
This data is completely dynamic, headers and data can change depending on the table that is chosen or what headers are picked.
Assignment group | Number | Short description | Created
Company Level 1 INC0039473 No access to email 01/02/2019 02:54:26
Company Level 2 INC0039474 This Incident is for SQL daily admin and pro-active checks. 01/02/2019 07:00:07
Company Level 2 INC0039475 Suspicious email 01/02/2019 07:14:05
Company Level 1 INC0039476 remove mailbox access 01/02/2019 07:30:51
Company Level 1 INC0039477 PDC - LogicMonitor - Server Offline 01/02/2019 08:25:56
Company Level 1 INC0039479 Unable to login to citrix 01/02/2019 08:44:21
HTML
<div ng-if="reportDetails.isList">
<table class="etable" >
<tbody>
<tr class="eborder">
<th ng-repeat="(key, data) in reportDetails.values[0]">{{key}}</th>
</tr>
<tr ng-repeat="(key, data) in reportDetails.values">
<td ng-repeat="rows in reportDetails.values[key]">{{rows}}</td>
</tr>
</tbody>
</table>
</div>
JSON DATA
"values":[
{
"Number":"INC0039473",
"Assignment group":"Company Level 1",
"Created":"01/02/2019 02:54:26",
"Short description":"No access to email"
},
{
"Number":"INC0039474",
"Assignment group":"Company Level 2",
"Created":"01/02/2019 07:00:07",
"Short description":"This Incident is for SQL daily admin and pro-active checks."
},
{
"Number":"INC0039475",
"Assignment group":"Company Level 2",
"Created":"01/02/2019 07:14:05",
"Short description":"Suspicious email"
},
{
"Number":"INC0039476",
"Assignment group":"Company Level 1",
"Created":"01/02/2019 07:30:51",
"Short description":"remove mailbox access"
},
{
"Number":"INC0039477",
"Assignment group":"Company Level 1",
"Created":"01/02/2019 08:25:56",
"Short description":"PDC - LogicMonitor - Server Offline"