From 48c2ca6e982628879d80fa85ad3e4d7a36bbce06 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Mon, 25 Jan 2016 13:46:01 -0500 Subject: [PATCH] test(tabs): add modal to the basic tabs test to make sure it opens properly references #5126 --- ionic/components/tabs/test/basic/index.ts | 72 ++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/ionic/components/tabs/test/basic/index.ts b/ionic/components/tabs/test/basic/index.ts index 82628beee0..bd293e6257 100644 --- a/ionic/components/tabs/test/basic/index.ts +++ b/ionic/components/tabs/test/basic/index.ts @@ -1,4 +1,57 @@ - import {App, Page, NavController, Alert} from 'ionic/ionic'; + import {App, Page, NavController, Alert, Modal, ViewController} from 'ionic/ionic'; + +// +// Modal +// +@Page({ + template: ` + + + + + + + Filter Sessions + + + + + + + + + + Tracks + + + Toggle {{i}} + + + + + + + + ` +}) +class MyModal { + constructor(viewCtrl: ViewController) { + this.viewCtrl = viewCtrl; + + this.items = []; + for(var i = 1; i <= 10; i++) { + this.items.push(i); + } + } + + dismiss() { + // using the injected ViewController this page + // can "dismiss" itself and pass back data + this.viewCtrl.dismiss(); + } +} // // Tab 1 @@ -80,6 +133,7 @@ class Tab2 {

Tab 3

+

` @@ -96,10 +150,15 @@ class Tab3 { }); this.nav.present(alert); } + + presentModal() { + let modal = Modal.create(MyModal); + this.nav.present(modal); + } } -@App({ +@Page({ template: ` @@ -128,3 +187,12 @@ export class TabsPage { this.root3 = Tab3; } } + +@App({ + template: `` +}) +export class e2eApp { + constructor() { + this.root = TabsPage; + } +}