ion-reorder-button

(ionic-china中文网文档)ionItem的内部项

实例该文档来自ionic中文网ionic-china

<ion-list ng-controller="MyCtrl" show-reorder="true">
  <ion-item ng-repeat="item in items">
    Item 
    <ion-reorder-button class="ion-navicon"
                        on-reorder="moveItem(item, $fromIndex, $toIndex)">
    </ion-reorder-button>
  </ion-item>
</ion-list>
function MyCtrl($scope) {
  $scope.items = [1, 2, 3, 4];
  $scope.moveItem = function(item, fromIndex, toIndex) {
    //Move the item in the array
    $scope.items.splice(fromIndex, 1);
    $scope.items.splice(toIndex, 0, item);
  };
}

API

属性 类型 说明
on-reorder
(可空)
expression

重新排序调用的表达式 参数:$fromIndex, $toIndex.