mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
MODAL MODAL
This commit is contained in:
@@ -7,7 +7,7 @@ import {Nav} from 'ionic/ionic';
|
||||
|
||||
import {raf, ready} from 'ionic/util/dom'
|
||||
|
||||
import {NavController, NavbarTemplate, Navbar, Content} from 'ionic/ionic';
|
||||
import {NavController, NavParams, NavbarTemplate, Navbar, Content} from 'ionic/ionic';
|
||||
|
||||
@Component({
|
||||
selector: 'ion-modal-wrapper'
|
||||
@@ -117,5 +117,48 @@ export class ModalFirstPage {
|
||||
}
|
||||
|
||||
push() {
|
||||
this.nav.push(ModalSecondPage, { id: 8675309, myData: [1,2,3,4] }, { animation: 'ios' });
|
||||
}
|
||||
}
|
||||
|
||||
@Component({selector: 'ion-view'})
|
||||
@View({
|
||||
template: `
|
||||
<ion-navbar *navbar><ion-title>Second Page Header</ion-title></ion-navbar>
|
||||
|
||||
<ion-content class="padding">
|
||||
|
||||
<p>
|
||||
<button class="button" (click)="pop()">Pop (Go back to 1st)</button>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<button class="button" (click)="push()">Push (Go to 3rd)</button>
|
||||
</p>
|
||||
|
||||
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
|
||||
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
|
||||
|
||||
</ion-content>
|
||||
`,
|
||||
directives: [NavbarTemplate, Navbar, Content]
|
||||
})
|
||||
export class ModalSecondPage {
|
||||
constructor(
|
||||
nav: NavController,
|
||||
params: NavParams
|
||||
) {
|
||||
this.nav = nav;
|
||||
this.params = params;
|
||||
|
||||
console.log('Second page params:', params);
|
||||
}
|
||||
|
||||
pop() {
|
||||
this.nav.pop();
|
||||
}
|
||||
|
||||
push() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user