AngularJS中如何去掉 ng-repeat的自动排序?

varrecords={"2013":[{order_year:"2013",order_date:"3-5",order_number:"A123445678",mil... var records = {
"2013": [
{order_year:"2013", order_date:"3-5", order_number: "A123445678", mileage: 20000, sname: "华盛汽车" },
{order_year:"2013", order_date:"6-5", order_number: "A123445678", mileage: 28000, sname: "华盛汽车" },
{order_year:"2013", order_date:"3-25", order_number: "A123445678", mileage: 16000, sname: "华盛汽车" }
],
"2016": [
{order_year:"2016", order_date:"3-25", order_number: "A123445678", mileage: 14000, sname: "华盛汽车" }
],
"2012": [
{order_year:"2012", order_date:"3-25", order_number: "A123445678", mileage: 14000, sname: "华盛汽车" }
]};

这样一个数组,ng-repeat输出时自动按年份进行了排序,按照2012、2013、2016的顺序显示,但我需要按数组原顺序显示,不知如何禁止它自动帮我排序?
展开
 我来答
百度网友e2d7ae3
2015-03-21 · TA获得超过2207个赞
知道大有可为答主
回答量:1287
采纳率:0%
帮助的人:1609万
展开全部
$scope.records = {
"2013": [
{order_year:"2013", order_date:"3-5", order_number: "A123445678", mileage: 20000, sname: "华盛汽车" },
{order_year:"2013", order_date:"6-5", order_number: "A123445678", mileage: 28000, sname: "华盛汽车" },
{order_year:"2013", order_date:"3-25", order_number: "A123445678", mileage: 16000, sname: "华盛汽车" }
], 
"2016": [
{order_year:"2016", order_date:"3-25", order_number: "A123445678", mileage: 14000, sname: "华盛汽车" }
], 
"2012": [
{order_year:"2012", order_date:"3-25", order_number: "A123445678", mileage: 14000, sname: "华盛汽车" }
]}; 

$scope.keys = Object.keys($scope.records);
<div ng-repeat="key in keys">
        {{records[key]}}
    </div>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式