Hi all. I have a same problem with ion-list and reordering.
I created a ion list with sortable (reordering) feature.
It the html code:
<ion-list ng-hide="fullMap" show-reorder="data.showReorder">
<ion-item ng-repeat="place in places" item="item">
<ion-reorder-button class="ion-navicon"
on-reorder="moveItem(item, $fromIndex, $toIndex)">
</ion-reorder-button>
<div class="route-number-icon left">
{{ $index+1 }}
</div>
</ion-item>
</ion-list>
It’s reordering function in my controller:
$scope.moveItem = function(item, fromIndex, toIndex) {
var exercise = $scope.places[fromIndex];
$scope.places.splice(fromIndex, 1);
$scope.places.splice(toIndex, 0, exercise);
};
it’s work fine for android, but in iOS after change order of items (with ionic reordering button) in list displayed equals numbers of position in list.
-
Before reordering:
-
After reordering: