Files
ionic-framework/packages/core/src/components/action-sheet-controller
Manu Mtz.-Almeida ae77a64b37 fix(overlays): typescript is our friend
By using typescript generics we are able to detect at
compiler time that the overlay options conform with the
overlay implementation.
2018-02-23 10:54:28 +01:00
..

ion-action-sheet-controller

Action Sheet controllers programmatically control the action sheet component. Action Sheets can be created and dismissed from the action sheet controller. View the Action Sheet documentation for a full list of options to pass upon creation.

async function presentBasic() {
  const actionSheetController = document.querySelector('ion-action-sheet-controller');
  await actionSheetController.componentOnReady();

  const actionSheetElement = await actionSheetController.create({
    title: "Albums",
    buttons: [{
      text: 'Delete',
      role: 'destructive',
      icon: 'trash',
      handler: () => {
        console.log('Delete clicked');
      }
    }, {
      text: 'Share',
      icon: 'share',
      handler: () => {
        console.log('Share clicked');
      }
    }, {
      text: 'Play (open modal)',
      icon: 'arrow-dropright-circle',
      handler: () => {
        console.log('Play clicked');
      }
    }, {
      text: 'Favorite',
      icon: 'heart',
      handler: () => {
        console.log('Favorite clicked');
      }
    }, {
      text: 'Cancel',
      icon: 'close',
      role: 'cancel',
      handler: () => {
        console.log('Cancel clicked');
      }
    }]
  });
  await actionSheetElement.present();
}

Methods

create()

dismiss()

getTop()


Built with StencilJS