【发布时间】:2018-01-31 17:24:48
【问题描述】:
如何在 ng-repeat 中停止对动态表数据的默认排序?
目前我的订单如下:
地址 |客户 ID |名称
但我想要的是低于订购:
客户 ID |姓名 |地址
任何帮助将不胜感激。
JS:
app.controller('MyController', function ($scope) {
$scope.Customers = [
{ CustomerId: 1, Name: "John Hammond", Addr:'India'
},
{
CustomerId: 2, Name: "Mudassar Khan", Addr:'India'
},
{
CustomerId: 3, Name: "Suzanne Mathews", Addr:'India'
},
{
CustomerId: 4, Name: "Robert Schidner", Addr: 'India'
}
];
});
HTML:
<table>
<tr >
<th ng-repeat="(key,value) in Customers[0]">{{key}}</th>
</tr>
<tbody ng-repeat="c in Customers">
<tr>
</tr>
</tbody>
</table>
【问题讨论】:
标签: javascript html angularjs angularjs-ng-repeat