diff --git a/demos/action-sheet/app.html b/demos/action-sheet/app.html
index 5f6bb33d68..7b88c96996 100644
--- a/demos/action-sheet/app.html
+++ b/demos/action-sheet/app.html
@@ -1,2 +1 @@
-
-
\ No newline at end of file
+
diff --git a/demos/action-sheet/index.ts b/demos/action-sheet/index.ts
index 829799ce6b..66ac40f4af 100644
--- a/demos/action-sheet/index.ts
+++ b/demos/action-sheet/index.ts
@@ -1,51 +1,50 @@
-import {App, Page, IonicApp, Config, Platform} from 'ionic/ionic';
-import {ActionSheet} from 'ionic/ionic';
+import {App, Page, ActionSheet, NavController} from 'ionic/ionic';
+
@App({
templateUrl: 'app.html'
})
class ApiDemoApp {
-
constructor() {
this.rootPage = InitialPage;
}
}
+
@Page({
templateUrl: 'main.html'
})
export class InitialPage {
- constructor(actionSheet: ActionSheet, platform: Platform) {
- this.actionSheet = actionSheet;
- this.platform = platform;
+ constructor(nav: NavController) {
+ this.nav = nav;
}
- open() {
-
- this.actionSheet.open({
+ present() {
+ let actionSheet = ActionSheet.create({
buttons: [
- { text: 'Share'},
- { text: 'Play'},
- { text: 'Favorite'}
- ],
- destructiveText: 'Delete',
- titleText: 'Albums',
- cancelText: 'Cancel',
- cancel: () => {
- console.log('Canceled');
- },
- destructiveButtonClicked: () => {
- console.log('Destructive clicked');
- },
- buttonClicked: (index) => {
- console.log('Button clicked', index);
- if (index == 1) { return false; }
- return true;
- }
-
- }).then(actionSheetRef => {
- this.actionSheetRef = actionSheetRef;
+ {
+ text: 'Destructive',
+ style: 'destructive',
+ handler: () => {
+ console.log('Destructive clicked');
+ }
+ },
+ {
+ text: 'Archive',
+ handler: () => {
+ console.log('Archive clicked');
+ }
+ },
+ {
+ text: 'Cancel',
+ style: 'cancel',
+ handler: () => {
+ console.log('Cancel clicked');
+ }
+ }
+ ]
});
+
+ this.nav.present(actionSheet);
}
}
-
diff --git a/demos/action-sheet/main.html b/demos/action-sheet/main.html
index 58ebcd2cac..b0f9998425 100644
--- a/demos/action-sheet/main.html
+++ b/demos/action-sheet/main.html
@@ -4,6 +4,6 @@
-
+