diff --git a/src/components/modal/test/basic/app-module.ts b/src/components/modal/test/basic/app-module.ts
index 91116b8db42..92238d0af70 100644
--- a/src/components/modal/test/basic/app-module.ts
+++ b/src/components/modal/test/basic/app-module.ts
@@ -1,8 +1,8 @@
import { Component, Injectable, NgModule } from '@angular/core';
-import { ActionSheetController, App, Config,
+import { ActionSheetController, AlertController, App, Config,
IonicApp, IonicModule, ModalController, NavController,
- NavParams, Platform, ViewController } from '../../../..';
+ NavParams, Platform, ToastController, ViewController } from '../../../..';
@Injectable()
@@ -67,7 +67,7 @@ export class E2EPage {
console.timeEnd('modal');
});
modal.onDidDismiss((data: any) => {
- console.log('modal data', data);
+ console.log('DID DISMISS modal data', data);
console.timeEnd('modal');
});
}
@@ -89,10 +89,6 @@ export class E2EPage {
modal.present();
}
- presentNavigableModal() {
- this.modalCtrl.create(NavigableModal).present();
- }
-
ionViewDidLoad() {
console.log('E2EPage ionViewDidLoad fired');
}
@@ -114,61 +110,6 @@ export class E2EPage {
}
}
-@Component({
- template: `
-
-
-
-
-
- Page One
-
-
-
-
-
- NavigableModal
-
-
-
- `
-})
-export class NavigableModal {
-
- constructor(public navCtrl: NavController, public viewCtrl: ViewController) {}
-
- submit() {
- this.navCtrl.push(NavigableModal2);
- }
-
- dismiss() {
- this.viewCtrl.dismiss();
- }
-}
-
-@Component({
- template: `
-
-
- Page Two
-
-
-
-
-
-
- `
-})
-export class NavigableModal2 {
-
- constructor(public navCtrl: NavController) {}
-
- submit() {
- this.navCtrl.pop();
- }
-}
-
-
@Component({
template: `
@@ -196,7 +137,12 @@ export class NavigableModal2 {
export class ModalPassData {
data: any;
- constructor(params: NavParams, public viewCtrl: ViewController, someComponentProvider: SomeComponentProvider, someAppProvider: SomeAppProvider) {
+ constructor(
+ public viewCtrl: ViewController,
+ public toastCtrl: ToastController,
+ params: NavParams,
+ someComponentProvider: SomeComponentProvider,
+ someAppProvider: SomeAppProvider) {
this.data = {
userId: params.get('userId'),
name: someComponentProvider.getName()
@@ -219,6 +165,10 @@ export class ModalPassData {
ionViewDidEnter() {
console.log('ModalPassData ionViewDidEnter fired');
+ this.toastCtrl.create({
+ message: 'test toast',
+ duration: 1000
+ }).present();
}
ionViewWillLeave() {
@@ -266,7 +216,20 @@ export class ModalPassData {
})
export class ToolbarModal {
- constructor(public viewCtrl: ViewController) {}
+ constructor(public viewCtrl: ViewController, public alertCtrl: AlertController) {}
+
+ ionViewDidEnter() {
+ let alert = this.alertCtrl.create({
+ title: 'Test',
+ buttons: [
+ {
+ text: 'Something',
+ role: 'cancel'
+ }
+ ]
+ });
+ alert.present();
+ }
dismiss() {
this.viewCtrl.dismiss();
@@ -391,7 +354,11 @@ export class ContactUs {
export class ModalFirstPage {
items: any[] = [];
- constructor(public navCtrl: NavController, public app: App, public actionSheetCtrl: ActionSheetController) {
+ constructor(
+ public navCtrl: NavController,
+ public app: App,
+ public actionSheetCtrl: ActionSheetController,
+ public alertCtrl: AlertController) {
for (let i = 0; i < 50; i++) {
this.items.push({
value: (i + 1)
@@ -420,6 +387,16 @@ export class ModalFirstPage {
ionViewDidEnter() {
console.log('ModalFirstPage ionViewDidEnter fired');
+ let alert = this.alertCtrl.create({
+ title: 'Test',
+ buttons: [
+ {
+ text: 'Something',
+ role: 'cancel'
+ }
+ ]
+ });
+ alert.present();
}
openActionSheet() {
@@ -517,13 +494,13 @@ export class E2EApp {
ModalSecondPage,
ModalWithInputs,
ContactUs,
- NavigableModal,
- NavigableModal2,
ModalPassData,
ToolbarModal
],
imports: [
- IonicModule.forRoot(E2EApp)
+ IonicModule.forRoot(E2EApp, {
+ statusbarPadding: true
+ })
],
bootstrap: [IonicApp],
providers: [SomeAppProvider],
@@ -534,8 +511,6 @@ export class E2EApp {
ModalSecondPage,
ModalWithInputs,
ContactUs,
- NavigableModal,
- NavigableModal2,
ModalPassData,
ToolbarModal
]
diff --git a/src/components/modal/test/basic/main.html b/src/components/modal/test/basic/main.html
index 8a43c64807d..323e6120552 100644
--- a/src/components/modal/test/basic/main.html
+++ b/src/components/modal/test/basic/main.html
@@ -12,14 +12,11 @@
-
-
-
-
+