$ionicListDelegate

Delegate for controlling the ionList directive.

Methods called directly on the $ionicListDelegate service will control all lists. Use the $getByHandle method to control specific ionList instances.

Usage


<ion-content ng-controller="MyCtrl">
  <button class="button" ng-click="showDeleteButtons()"></button>
  <ion-list>
    <ion-item ng-repeat="i in items">
      Hello, {{i}}!
      <ion-delete-button class="ion-minus-circled"></ion-delete-button>
    </ion-item>
  </ion-list>
</ion-content>

function MyCtrl($scope, $ionicListDelegate) {
  $scope.showDeleteButtons = function() {
    $ionicListDelegate.showDelete(true);
  };
}

Methods

showReorder([showReorder])

Param Type Details
showReorder
(optional)
boolean

Set whether or not this list is showing its reorder buttons.

  • Returns: boolean Whether the reorder buttons are shown.

showDelete([showDelete])

Param Type Details
showDelete
(optional)
boolean

Set whether or not this list is showing its delete buttons.

  • Returns: boolean Whether the delete buttons are shown.

canSwipeItems([canSwipeItems])

Param Type Details
canSwipeItems
(optional)
boolean

Set whether or not this list is able to swipe to show option buttons.

  • Returns: boolean Whether the list is able to swipe to show option buttons.

closeOptionButtons()

Closes any option buttons on the list that are swiped open.

$getByHandle(handle)

Param Type Details
handle string
  • Returns: delegateInstance A delegate instance that controls only the ionList directives with delegate-handle matching the given handle.

Example: $ionicListDelegate.$getByHandle('my-handle').showReorder(true);