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

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -