I’m trying to make a reorder-able list of attributes underneath a header in a larger list. I’m not sure if I’m missing something as I’ve only been using Ionic for a week so any input would be appreciated
In my controller, I print out all of the values passed (item, $index, $fromIndex, $toIndex), and item and $index both have the right value, but both $fromIndex and $toIndex are 0 regardless of where I’m dragging it to/from.
My code is as follows:
<div class="item item-divider item-button-right">
Header
<button class="button button-clear button-stable button-icon" ui-sref="header">
<i class="icon ion-ios7-arrow-right"></i>
</button>
<div>
<ion-list ng-if="items !== undefined" ng-repeat="item in items" show-reorder="true">
<ion-item ng-controller="itemsCtrl">
<span style="margin-left: 50px;">{{item}}</span>
<ion-reorder-button class="ion-navicon" on-reorder="display(item, $index, $fromIndex, $toIndex)">
</ion-reorder-button>
</ion-item>
</ion-list>
</div>