본문 바로가기

Web/Ionic

[Ionic] Components Action Sheets


action-sheet.html

<ion-header>
  <ion-navbar>
    <button ion-button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>Action Sheet Page</ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding>
  <button ion-button block (click)="presentActionSheet()">
    Show Action Sheet
  </button>
</ion-content>


action-sheet.ts

import { Component } from '@angular/core';
import { ActionSheetController } from 'ionic-angular';

@Component({
    templateUrl: 'action-sheet.html'
})
export class ActionSheetPage {
    constructor(public actionSheetCtrl: ActionSheetController) {
    
    }

    presentActionSheet() {
        let actionSheet = this.actionSheetCtrl.create({
            title: 'action sheet demo',
            buttons: [
                {
                    text: 'Delete',
                    role: 'destructive',
                    handler: () => {

                    }
                },
                {
                    text: 'button',
                    handler: () => {

                    }
                },
                {
                    text: 'cancel',
                    role: 'cancel',
                    handler: () => {
                        
                    }
                }
            ]
        });
        actionSheet.present();
    }
}



'Web > Ionic' 카테고리의 다른 글

[Ionic] Components Buttons  (0) 2017.03.28
[Ionic] Components Alerts  (0) 2017.03.27
[Ionic] sidemenu 앱에서 페이지 추가하기  (0) 2017.03.22
[Ionic] 프로젝트 만들기  (0) 2017.03.22
[Ionic] 앱 개발을 위한 준비  (0) 2017.03.17