4
HI我在Chrome和浏览器的数据排序中得到了不同的结果。 Firefox显示正确的一个。Angularjs:在Chrome浏览器和Firefox浏览器中排序显示不同的结果
HTML:
<table class="datatable">
<thead>
<tr>
<th width="5%" class="Rank">Rank <a ng-click="sort_by('Rank')"><i class="icon-sort" ng-show="pagedItems[currentPage].length > 1"></i></a></th>
<th width="10%" class="Interviews">Interviews <a ng-click="sort_by('Interviews')"><i class="icon-sort" ng-show="pagedItems[currentPage].length > 1"></i></a></th>
<th width="25%" class="Dealership">Dealership <a ng-click="sort_by('Dealership')"><i class="icon-sort" ng-show="pagedItems[currentPage].length > 1"></i></a></th>
<th width="15%" class="Satisfaction">Overall Satisfaction <a ng-click="sort_by('Satisfaction')"><i class="icon-sort" ng-show="pagedItems[currentPage].length > 1"></i></a></th>
<th width="15%" class="Loyalty">Loyalty <a ng-click="sort_by('Loyalty')"><i class="icon-sort" ng-show="pagedItems[currentPage].length > 1"></i></a></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in pagedItems[currentPage] | orderBy:sortingOrder:reverse">
<td>{{item.Rank}} - {{item.$$hashKey}}</td>
<td>{{item.Interviews}}</td>
<td>{{item.Dealership}}</td>
<td>{{item.Satisfaction | number:1}}</td>
<td>{{item.Loyalty}}</td>
</tr>
</tbody>
我初步排序,以秩:
角控制器代码:
$scope.sortingOrder = sortingOrder;
$scope.reverse = false;
结果在Firefox中:排名列显示等级与Hashkey值
Chrome的结果:排名列显示了Hashkey值
在这里,我以秩排序排名。具有相同等级的数据按其$$ $$ hashkey进行排序。 Firefox提供$$ hashkey以获取数据。作为Chrome的第二个记录在给予散列键时最后持续。
我无法理解为什么会发生这种情况。有什么办法可以避免。
在此先感谢。