angularjs - Angular create table from json resulting in sorted headings -
i have angular app in creating table based on json follows:
<thead> <tr> <th ng-repeat="(header, value) in resultdata[0]"> {{header}} </th> </tr> </thead> <tbody> <tr ng-repeat="row in resultdata"> <td ng-repeat="cell in row"> {{cell}} </td> </tr> </tbody>
here table creates headings content json
. result of code table sorted headings. there way keep order same in json
file?
your headers in object. javascript objects not guarantee property order. see this question. preserve order, have use array in json file.
Comments
Post a Comment