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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -