refactor(navCtrl): move async parts of transition into their own fn

This commit is contained in:
Adam Bradley
2015-12-01 19:59:21 -06:00
parent 8889e0a71e
commit 85e773b56b
5 changed files with 269 additions and 154 deletions

View File

@@ -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() {