mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(navCtrl): move async parts of transition into their own fn
This commit is contained in:
@@ -39,6 +39,7 @@ class MyCmpTest{}
|
||||
<button ion-item (click)="setPages()">setPages() (Go to PrimaryHeaderPage)</button>
|
||||
<button ion-item (click)="setRoot()">setRoot(PrimaryHeaderPage) (Go to PrimaryHeaderPage)</button>
|
||||
<button ion-item (click)="nav.pop()">Pop</button>
|
||||
<button ion-item (click)="reload()">Reload</button>
|
||||
|
||||
<button *ng-for="#i of pages" ion-item (click)="pushPrimaryHeaderPage()">Page {{i}}</button>
|
||||
</ion-list>
|
||||
@@ -86,6 +87,10 @@ class FirstPage {
|
||||
pushAnother() {
|
||||
this.nav.push(AnotherPage);
|
||||
}
|
||||
|
||||
reload() {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,9 +159,15 @@ class FullPage {
|
||||
})
|
||||
class PrimaryHeaderPage {
|
||||
constructor(
|
||||
nav: NavController
|
||||
nav: NavController,
|
||||
viewCtrl: ViewController
|
||||
) {
|
||||
this.nav = nav
|
||||
this.nav = nav;
|
||||
this.viewCtrl = viewCtrl;
|
||||
}
|
||||
|
||||
onPageWillEnter() {
|
||||
this.viewCtrl.setBackButtonText('Previous');
|
||||
}
|
||||
|
||||
pushAnother() {
|
||||
|
||||
Reference in New Issue
Block a user