AngularJS ng重复命令不工作
我试图在表中使用Angular的orderBy对对象列表进行排序AngularJS ng重复命令不工作,angularjs,Angularjs,我试图在表中使用Angular的orderBy对对象列表进行排序 <div ng-repeat="processing in model.Processings" class="onePaddingBottom"> <table datatable="ng" class="table-bordered"> <tbody > <tr ng-repeat="pointer in processing.Proc
<div ng-repeat="processing in model.Processings" class="onePaddingBottom">
<table datatable="ng" class="table-bordered">
<tbody >
<tr ng-repeat="pointer in processing.ProcessingPointers | orderBy:'Sequence'" >
<td class="col-md-1">
<input type="text" ng-model="pointer.Sequence" readonly=""/>
</td>
<td><input ng-model="pointer.Name" /></td>
</tr>
</tbody>
</table>
</div>
模型
var Model = function () {
this.Processings = []; // array of Processings seen below
this.categories = [];
this.Rules = [];
};
var Processing = function (carrierService) {
this.ProcessingId = 0;
this.categoryId = 1;
this.Rules = [];
this.category = "";
this.ProcessingPointers = []; // array of Pointers seen below.
}
var Pointer = function () {
this.ProcessingID = 0;
this.ProcessingRuleTypeID = 0;
this.Sequence = 0;
this.Name = "";
// other data items
}
填充表格时,对象的顺序不正确。序列中的顶部项目始终是最高的项目,其余项目按顺序排列。因此,如果我的指针数组是
var pointers = [
{Sequence: 1, Name:"John"},
{Sequence: 2, Name:"Jane"},
{Sequence: 3, Name:"Joe"},
{Sequence: 4, Name:"Jill"}
];
顺序总是4,1,2,3。是什么导致了这种订购
更新
下面是一个截图
Sequence似乎在IE上有效,但在Chrome或Firefox上无效。无法重现错误。在这个()上做了一个plnkr,起初认为这是嵌套ng重复的问题-但在我的plnkr中它工作得很好。我更新了这个问题,因为它似乎发生在Chrome上,而不是IE上。
var pointers = [
{Sequence: 1, Name:"John"},
{Sequence: 2, Name:"Jane"},
{Sequence: 3, Name:"Joe"},
{Sequence: 4, Name:"Jill"}
];