test(): update to public navCtrl convention

This commit is contained in:
Adam Bradley
2016-08-04 13:50:15 -05:00
parent 478ac45211
commit 3c493652b2
36 changed files with 154 additions and 145 deletions

View File

@ -85,7 +85,7 @@ export class ApiDemoPage {
config: any;
initialConfig: any;
constructor(public platform: Platform, public nav: NavController) {
constructor(public platform: Platform, public navCtrl: NavController) {
if (window.localStorage.getItem('configDemo') !== null) {
this.config = JSON.parse(window.localStorage.getItem('configDemo'));
@ -113,7 +113,7 @@ export class ApiDemoPage {
}
push() {
this.nav.push(PushPage);
this.navCtrl.push(PushPage);
}
}
@ -121,10 +121,10 @@ export class ApiDemoPage {
templateUrl: 'page.html'
})
export class PushPage {
constructor(public nav: NavController) {}
constructor(public navCtrl: NavController) {}
pop() {
this.nav.pop();
this.navCtrl.pop();
}
}

View File

@ -11,7 +11,7 @@ class ApiDemoPage {
editButton: string = 'Edit';
editing: boolean = false;
constructor(private nav: NavController) {
constructor(public navCtrl: NavController) {
this.songs = [
{
title: 'Everything Beta',

View File

@ -7,7 +7,7 @@ import { ionicBootstrap, LoadingController, NavController } from 'ionic-angular'
templateUrl: 'main.html'
})
class Page1 {
constructor(private loadingCtrl: LoadingController, private nav: NavController) {}
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoadingIos() {
let loading = this.loadingCtrl.create({
@ -100,7 +100,7 @@ class Page1 {
loading.present();
setTimeout(() => {
this.nav.push(Page2);
this.navCtrl.push(Page2);
}, 1000);
setTimeout(() => {

View File

@ -35,7 +35,6 @@ export class ModalContentPage {
myParam: string;
constructor(
public nav: NavController,
public viewCtrl: ViewController,
params: NavParams
) {

View File

@ -9,10 +9,10 @@ import { ionicBootstrap, NavController, NavParams } from 'ionic-angular';
export class ApiDemoPage {
myParam: string = '';
constructor(public nav: NavController) {}
constructor(public navCtrl: NavController) {}
pushParams() {
this.nav.push(PushPage, { 'myParam': this.myParam });
this.navCtrl.push(PushPage, { 'myParam': this.myParam });
}
}
@ -23,7 +23,7 @@ export class ApiDemoPage {
export class PushPage {
myParam: string;
constructor(public nav: NavController, params: NavParams) {
constructor(params: NavParams) {
this.myParam = params.get('myParam');
}
}

View File

@ -9,10 +9,10 @@ var PAGE_NUM = 2;
templateUrl: 'main.html'
})
export class ApiDemoPage {
constructor(public nav: NavController) {}
constructor(public navCtrl: NavController) {}
push() {
this.nav.push(PushPage);
this.navCtrl.push(PushPage);
}
}
@ -22,18 +22,18 @@ export class ApiDemoPage {
export class PushPage {
pageNum = PAGE_NUM;
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
push() {
PAGE_NUM++;
this.nav.push(PushPage);
this.navCtrl.push(PushPage);
}
pop() {
if (PAGE_NUM > 2) {
PAGE_NUM--;
}
this.nav.pop();
this.navCtrl.pop();
}
}

View File

@ -112,7 +112,7 @@ export class ActionSheet extends ViewController {
*
* export class MyClass{
*
* constructor(private actionSheetCtrl: ActionSheetController) {}
* constructor(public actionSheetCtrl: ActionSheetController) {}
*
* presentActionSheet() {
* let actionSheet = this.actionSheetCtrl.create({

View File

@ -8,7 +8,7 @@ import { FormBuilder, ControlGroup, Validators } from '@angular/common';
})
export class E2EPage {
constructor(private alertCtrl: AlertController, private nav: NavController) {}
constructor(public alertCtrl: AlertController, public navCtrl: NavController) {}
submit() {
var alert = this.alertCtrl.create({
@ -26,7 +26,7 @@ export class E2EPage {
alert.onDidDismiss(() => {
console.log('dismiss');
this.nav.push(AnotherPage);
this.navCtrl.push(AnotherPage);
});
alert.present();
@ -63,7 +63,7 @@ export class E2EPage {
class AnotherPage {
form: ControlGroup;
constructor(private nav: NavController, private alertCtrl: AlertController, private loadingCtrl: LoadingController, private builder: FormBuilder) {
constructor(public navCtrl: NavController, public alertCtrl: AlertController, public loadingCtrl: LoadingController, public builder: FormBuilder) {
this.form = builder.group({
name: builder.control('', Validators.compose([
Validators.required,
@ -98,7 +98,7 @@ class AnotherPage {
role: 'cancel',
handler: () => {
alert.dismiss().then(() => {
this.nav.pop();
this.navCtrl.pop();
});
return false;
}
@ -137,7 +137,7 @@ class AnotherPage {
alert.dismiss().then(() => {
// after the alert has been dismissed
// then you can do another nav transition
this.nav.pop();
this.navCtrl.pop();
});
}, 100);

View File

@ -45,7 +45,7 @@ export class OtherData {
`
})
class MyModal {
constructor(private viewCtrl: ViewController) {}
constructor(public viewCtrl: ViewController) {}
dismissModal() {
this.viewCtrl.dismiss();
@ -60,13 +60,13 @@ class Page1 {
page2 = Page2;
sort: string = 'all';
constructor(private nav: NavController, private someData: SomeData, private otherData: OtherData) {
constructor(public navCtrl: NavController, public someData: SomeData, public otherData: OtherData) {
console.log('Got some data from', someData.getData());
console.log('Got some data from', otherData.getData());
}
goToTabs() {
this.nav.push(TabsPage);
this.navCtrl.push(TabsPage);
}
}
@ -78,7 +78,7 @@ class Page2 {
page1 = Page1;
page3 = Page3;
constructor(private modalCtrl: ModalController) {}
constructor(public modalCtrl: ModalController) {}
openModal() {
this.modalCtrl.create(MyModal).present();
@ -90,10 +90,10 @@ class Page2 {
templateUrl: 'page3.html'
})
class Page3 {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
goBack() {
this.nav.pop();
this.navCtrl.pop();
}
}
@ -118,9 +118,7 @@ class Page3 {
</ion-content>
`
})
class TabPage1 {
constructor(private nav: NavController) {}
}
class TabPage1 {}
@Component({
@ -131,10 +129,10 @@ class TabsPage {
tab2Root = Page2;
tab3Root = Page3;
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
goBack() {
this.nav.pop();
this.navCtrl.pop();
}
}

View File

@ -6,7 +6,7 @@ import { ionicBootstrap, MenuController, NavController, AlertController, Nav, Re
templateUrl: 'page1.html'
})
class Page1 {
constructor(private nav: NavController, private alertCtrl: AlertController) {}
constructor(public navCtrl: NavController, public alertCtrl: AlertController) {}
presentAlert() {
let alert = this.alertCtrl.create({
@ -19,7 +19,7 @@ class Page1 {
}
goToPage1() {
this.nav.push(Page1);
this.navCtrl.push(Page1);
}
doRefresh(refresher: Refresher) {

View File

@ -10,7 +10,7 @@ class E2EPage1 {
items: number[] = [];
enabled: boolean = true;
constructor(private nav: NavController) {
constructor(public navCtrl: NavController) {
for (var i = 0; i < 30; i++) {
this.items.push( this.items.length );
}
@ -35,7 +35,7 @@ class E2EPage1 {
}
goToPage2() {
this.nav.push(E2EPage2);
this.navCtrl.push(E2EPage2);
}
toggleInfiniteScroll() {
@ -46,10 +46,10 @@ class E2EPage1 {
@Component({
template: '<ion-content><button (click)="nav.pop()">Pop</button></ion-content>'
template: '<ion-content><button (click)="navCtrl.pop()">Pop</button></ion-content>'
})
class E2EPage2 {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
}

View File

@ -11,14 +11,14 @@ import { ionicBootstrap, NavController, NavParams } from '../../../../../src';
</ion-header>
<ion-content padding>
<p>{{session.description}}</p>
<p><button (click)="nav.pop()">Go Back</button></p>
<p><button (click)="navCtrl.pop()">Go Back</button></p>
</ion-content>
`
})
class SessionDetail {
session: any;
constructor(params: NavParams, public nav: NavController) {
constructor(params: NavParams, public navCtrl: NavController) {
this.session = params.data;
}
}
@ -30,14 +30,14 @@ class SessionDetail {
class SessionList {
data = data;
constructor(public nav: NavController) {}
constructor(public navCtrl: NavController) {}
addFavorite(timeSlot: any, session: any, slidingItem: any) {
console.error('addFavorite', timeSlot, session, slidingItem);
}
openSession(session: any) {
this.nav.push(SessionDetail, session);
this.navCtrl.push(SessionDetail, session);
}
reload() {

View File

@ -6,7 +6,7 @@ import { ionicBootstrap, LoadingController, NavController } from '../../../../..
templateUrl: 'main.html'
})
class E2EPage {
constructor(private loadingCtrl: LoadingController, private nav: NavController) {}
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoadingIos() {
let loading = this.loadingCtrl.create({
@ -99,7 +99,7 @@ class E2EPage {
loading.present();
setTimeout(() => {
this.nav.push(Page2);
this.navCtrl.push(Page2);
}, 1000);
setTimeout(() => {
@ -108,7 +108,7 @@ class E2EPage {
}
goToPage2() {
this.nav.push(Page2);
this.navCtrl.push(Page2);
}
presentLoadingMultiple() {
@ -180,7 +180,7 @@ class E2EPage {
loading3.present();
setTimeout(() => {
this.nav.push(Page2);
this.navCtrl.push(Page2);
}, 1000);
}, 1000);
}
@ -207,16 +207,16 @@ class E2EPage {
`
})
class Page2 {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
ionViewLoaded() {
setTimeout(() => {
this.nav.push(Page3);
this.navCtrl.push(Page3);
}, 1000);
}
goToPage3() {
this.nav.push(Page3);
this.navCtrl.push(Page3);
}
}

View File

@ -6,7 +6,7 @@ import { ionicBootstrap, LoadingController, NavController } from '../../../../..
templateUrl: 'main.html'
})
class E2EPage {
constructor(private loadingCtrl: LoadingController, private nav: NavController) {}
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoading() {
let loading = this.loadingCtrl.create({
@ -26,7 +26,7 @@ class E2EPage {
loading.present();
setTimeout(() => {
this.nav.push(Page2);
this.navCtrl.push(Page2);
setTimeout(() => {
loading.dismiss();

View File

@ -40,20 +40,20 @@ import { Platform } from '../../platform/platform';
* @Component({...})
* export class MyPage {
*
* constructor(private menu: MenuController) {
* constructor(public menuCtrl: MenuController) {
*
* }
*
* openMenu() {
* this.menu.open();
* this.menuCtrl.open();
* }
*
* closeMenu() {
* this.menu.close();
* this.menuCtrl.close();
* }
*
* toggleMenu() {
* this.menu.toggle();
* this.menuCtrl.toggle();
* }
*
* }

View File

@ -156,10 +156,10 @@ import { GestureController } from '../../gestures/gesture-controller';
*
* @Component({...})
* export class MyPage {
* constructor(private menu: MenuController) {}
* constructor(public menuCtrl: MenuController) {}
*
* openMenu() {
* this.menu.open();
* this.menuCtrl.open();
* }
* }
* ```

View File

@ -6,7 +6,7 @@ import { ionicBootstrap, MenuController, NavController, AlertController, Nav } f
templateUrl: 'page1.html'
})
class Page1 {
constructor(private nav: NavController, private alertCtrl: AlertController) {}
constructor(public navCtrl: NavController, public alertCtrl: AlertController) {}
presentAlert() {
let alert = this.alertCtrl.create({
@ -19,7 +19,7 @@ class Page1 {
}
goToPage2() {
this.nav.push(Page2);
this.navCtrl.push(Page2);
}
}
@ -30,10 +30,10 @@ class Page3 {}
@Component({templateUrl: 'page2.html'})
class Page2 {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
page3() {
this.nav.push(Page3);
this.navCtrl.push(Page3);
}
}
@ -47,7 +47,7 @@ class E2EPage {
pages: Array<{title: string, component: any}>;
@ViewChild(Nav) nav: Nav;
constructor(private menu: MenuController) {
constructor(public menuCtrl: MenuController) {
this.rootPage = Page1;
this.pages = [
@ -63,16 +63,16 @@ class E2EPage {
this.nav.setRoot(page.component).then(() => {
// wait for the root page to be completely loaded
// then close the menu
this.menu.close();
this.menuCtrl.close();
});
}
openRightMenu() {
this.menu.open('right');
this.menuCtrl.open('right');
}
openLeftMenu() {
this.menu.open('left');
this.menuCtrl.open('left');
}
onDrag(ev: any) {

View File

@ -26,29 +26,29 @@ class E2EApp {
page2 = Page2;
rootPage = Page1;
constructor(private app: App, private menu: MenuController) {
constructor(public app: App, public menuCtrl: MenuController) {
this.menu1Active();
}
openPage(p) {
openPage(p: any) {
// Get the <ion-nav> by id
this.nav.setRoot(p);
}
menu1Active() {
this.menu.enable(true, 'menu1');
this.menu.enable(false, 'menu2');
this.menu.enable(false, 'menu3');
this.menuCtrl.enable(true, 'menu1');
this.menuCtrl.enable(false, 'menu2');
this.menuCtrl.enable(false, 'menu3');
}
menu2Active() {
this.menu.enable(false, 'menu1');
this.menu.enable(true, 'menu2');
this.menu.enable(false, 'menu3');
this.menuCtrl.enable(false, 'menu1');
this.menuCtrl.enable(true, 'menu2');
this.menuCtrl.enable(false, 'menu3');
}
menu3Active() {
this.menu.enable(false, 'menu1');
this.menu.enable(false, 'menu2');
this.menu.enable(true, 'menu3');
this.menuCtrl.enable(false, 'menu1');
this.menuCtrl.enable(false, 'menu2');
this.menuCtrl.enable(true, 'menu3');
}
}

View File

@ -14,7 +14,7 @@ class E2EApp {
rootView = Page1;
constructor(private alertCtrl: AlertController) { }
constructor(public alertCtrl: AlertController) { }
openPage(menu: any, page: any) {
// close the menu when clicking a link from the menu

View File

@ -14,7 +14,7 @@ class E2EApp {
rootView = Page1;
constructor(private alertCtrl: AlertController) { }
constructor(public alertCtrl: AlertController) { }
openPage(menu: any, page: any) {
// close the menu when clicking a link from the menu

View File

@ -14,7 +14,7 @@ class E2EApp {
rootView = Page1;
openPage(menu, page) {
openPage(menu: any, page: any) {
// close the menu when clicking a link from the menu
menu.close();

View File

@ -101,7 +101,7 @@ export class Modal extends ViewController {
* @Component(...)
* class HomePage {
*
* constructor(private modalCtrl: ModalController) {
* constructor(public modalCtrl: ModalController) {
*
* }
*
@ -141,7 +141,7 @@ export class Modal extends ViewController {
* @Component(...)
* class HomePage {
*
* constructor(private modalCtrl: ModalController) {
* constructor(public modalCtrl: ModalController) {
*
* }
*
@ -163,7 +163,7 @@ export class Modal extends ViewController {
* @Component(...)
* class Profile {
*
* constructor(private viewCtrl: ViewController) {
* constructor(public viewCtrl: ViewController) {
*
* }
*

View File

@ -101,6 +101,26 @@ class E2EPage {
presentNavigableModal() {
this.modalCtrl.create(NavigableModal).present();
}
ionViewLoaded() {
console.log('E2EPage ionViewLoaded fired');
}
ionViewWillEnter() {
console.log('E2EPage ionViewWillEnter fired');
}
ionViewDidEnter() {
console.log('E2EPage ionViewDidEnter fired');
}
ionViewWillLeave() {
console.log('E2EPage ionViewWillLeave fired');
}
ionViewDidLeave() {
console.log('E2EPage ionViewDidLeave fired');
}
}
@Component({

View File

@ -71,7 +71,7 @@ import { ViewController } from './view-controller';
* import { NavController } from 'ionic-angular';
*
* class MyComponent {
* constructor(private nav: NavController) {
* constructor(public navCtrl: NavController) {
*
* }
* }
@ -148,14 +148,14 @@ import { ViewController } from './view-controller';
* `
* })
* export class StartPage {
* constructor(private nav: NavController) {
* constructor(public navCtrl: NavController) {
* }
*
* pushPage(){
* // push another page on to the navigation stack
* // causing the nav controller to transition to the new page
* // optional data can also be passed to the pushed page.
* this.nav.push(OtherPage, {
* this.navCtrl.push(OtherPage, {
* id: "123",
* name: "Carl"
* });

View File

@ -8,7 +8,7 @@
* @usage
* ```ts
* export class MyClass{
* constructor(private params: NavParams){
* constructor(public params: NavParams){
* // userParams is an object we have in our nav-parameters
* this.params.get('userParams');
* }
@ -33,7 +33,7 @@ export class NavParams {
*
* ```ts
* export class MyClass{
* constructor(private params: NavParams){
* constructor(public params: NavParams){
* // userParams is an object we have in our nav-parameters
* this.params.get('userParams');
* }

View File

@ -29,11 +29,11 @@ ionicBootstrap(E2EApp);
})
class LandingPage {
constructor(private nav: NavController) {
constructor(public navCtrl: NavController) {
}
goToPage() {
this.nav.push(FirstPage);
this.navCtrl.push(FirstPage);
}
}

View File

@ -15,10 +15,10 @@ import { ionicBootstrap, NavController } from '../../../../../src';
</ion-content>`,
})
class FirstPage {
constructor(public nav: NavController) {}
constructor(public navCtrl: NavController) {}
pushPage() {
this.nav.push(SecondPage);
this.navCtrl.push(SecondPage);
}
}
@ -38,10 +38,10 @@ class FirstPage {
`
})
class SecondPage {
constructor(public nav: NavController) {}
constructor(public navCtrl: NavController) {}
insertPage() {
this.nav.insert(1, InsertPage);
this.navCtrl.insert(1, InsertPage);
}
}

View File

@ -52,14 +52,14 @@ class Page1 {
class Page2 {
tmr: number;
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
play() {
this.tmr = setTimeout(() => {
count++;
console.log('pop', count);
this.nav.pop({
this.navCtrl.pop({
animate: animate
});
}, delay);

View File

@ -17,10 +17,10 @@ import { Config, Nav, App } from '../../../../../src';
`
})
export class Login {
constructor(private nav: NavController, private app: App) {}
constructor(public navCtrl: NavController, public app: App) {}
goToAccount() {
this.nav.push(Account);
this.navCtrl.push(Account);
}
goBack() {
@ -63,23 +63,23 @@ export class Account {
root = Dashboard;
constructor(private menu: MenuController, private app: App) {}
constructor(public menuCtrl: MenuController, public app: App) {}
goToProfile() {
this.accountNav.setRoot(Profile).then(() => {
this.menu.close();
this.menuCtrl.close();
});
}
goToDashboard() {
this.accountNav.setRoot(Dashboard).then(() => {
this.menu.close();
this.menuCtrl.close();
});
}
logOut() {
this.accountNav.setRoot(Login, null, { animate: true }).then(() => {
this.menu.close();
this.menuCtrl.close();
});
}
@ -107,14 +107,14 @@ export class Account {
`
})
export class Dashboard {
constructor(private nav: NavController, private app: App) {}
constructor(public navCtrl: NavController, public app: App) {}
goToProfile() {
this.nav.push(Profile);
this.navCtrl.push(Profile);
}
logOut() {
this.nav.parent.setRoot(Login, null, {
this.navCtrl.parent.setRoot(Login, null, {
animate: true,
direction: 'back'
});
@ -144,14 +144,14 @@ export class Dashboard {
`
})
export class Profile {
constructor(private nav: NavController, private app: App) {}
constructor(public navCtrl: NavController, public app: App) {}
goToDashboard() {
this.nav.push(Dashboard);
this.navCtrl.push(Dashboard);
}
logOut() {
this.nav.parent.setRoot(Login, null, {
this.navCtrl.parent.setRoot(Login, null, {
animate: true,
direction: 'back'
});

View File

@ -6,10 +6,10 @@ import { ionicBootstrap, NavController, NavParams } from '../../../../../src';
templateUrl: 'main.html'
})
class MainPage {
constructor(private _nav: NavController) { }
constructor(public navCtrl: NavController) { }
goToSecond() {
this._nav.push(SearchPage);
this.navCtrl.push(SearchPage);
}
}
@ -19,12 +19,12 @@ class MainPage {
class SearchPage {
items: string[];
constructor(private _nav: NavController) {
constructor(public navCtrl: NavController) {
this.initializeItems();
}
showDetail(item: any) {
this._nav.push(DetailPage, {city: item});
this.navCtrl.push(DetailPage, {city: item});
}
initializeItems() {

View File

@ -8,12 +8,12 @@ import { ionicBootstrap, NavController } from '../../../../../src';
class SegmentPage {
signInType: string;
constructor(public nav: NavController) {
constructor(public navCtrl: NavController) {
this.signInType = 'new';
}
goToPage2() {
this.nav.push(SegmentPage2);
this.navCtrl.push(SegmentPage2);
}
}

View File

@ -11,7 +11,7 @@ class IntroPage {
mySlideOptions: any;
showSlide: boolean = true;
constructor(private nav: NavController) {
constructor(public navCtrl: NavController) {
this.mySlideOptions = {
paginationClickable: true,
lazyLoading: true,
@ -38,7 +38,7 @@ class IntroPage {
}
skip() {
this.nav.push(MainPage);
this.navCtrl.push(MainPage);
}
}

View File

@ -7,10 +7,10 @@ import { App, ionicBootstrap, NavController, NavParams, ModalController, ViewCon
templateUrl: './signIn.html'
})
class SignIn {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
push() {
this.nav.push(TabsPage, {
this.navCtrl.push(TabsPage, {
userId: 8675309
});
}
@ -21,7 +21,7 @@ class SignIn {
templateUrl: './modalChat.html'
})
class ChatPage {
constructor(private viewCtrl: ViewController) {}
constructor(public viewCtrl: ViewController) {}
ionViewLoaded() {
console.log('ChatPage, ionViewLoaded');
@ -92,17 +92,17 @@ class TabsPage {
class Tab1Page1 {
userId: string;
constructor(private nav: NavController, private app: App, private tabs: Tabs, private params: NavParams) {
constructor(public navCtrl: NavController, public app: App, public tabs: Tabs, public params: NavParams) {
this.userId = params.get('userId');
}
push() {
this.nav.push(Tab1Page2);
this.navCtrl.push(Tab1Page2);
}
goBack() {
console.log('go back begin');
this.nav.pop().then((val: any) => {
this.navCtrl.pop().then((val: any) => {
console.log('go back completed', val);
});
}
@ -141,10 +141,10 @@ class Tab1Page1 {
templateUrl: './tab1page2.html'
})
class Tab1Page2 {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
push() {
this.nav.push(Tab1Page3);
this.navCtrl.push(Tab1Page3);
}
ionViewWillEnter() {
@ -173,7 +173,7 @@ class Tab1Page2 {
templateUrl: './tab1page3.html'
})
class Tab1Page3 {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
ionViewWillEnter() {
console.log('Tab1Page3, ionViewWillEnter');
@ -204,10 +204,10 @@ class Tab1Page3 {
templateUrl: './tab2page1.html'
})
class Tab2Page1 {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
push() {
this.nav.push(Tab2Page2);
this.navCtrl.push(Tab2Page2);
}
ionViewWillEnter() {
@ -236,10 +236,10 @@ class Tab2Page1 {
templateUrl: './tab2page2.html'
})
class Tab2Page2 {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
push() {
this.nav.push(Tab2Page3);
this.navCtrl.push(Tab2Page3);
}
ionViewWillEnter() {
@ -268,7 +268,7 @@ class Tab2Page2 {
templateUrl: './tab2page3.html'
})
class Tab2Page3 {
constructor(private nav: NavController) {}
constructor(public navCtrl: NavController) {}
ionViewWillEnter() {
console.log('Tab2Page3, ionViewWillEnter');

View File

@ -17,9 +17,7 @@ import { ionicBootstrap, NavController, Tab } from '../../../../../src';
</ion-content>
`
})
class Tab1 {
constructor(public nav: NavController) {}
}
class Tab1 {}
//
// Tab 2
@ -36,9 +34,7 @@ class Tab1 {
</ion-content>
`
})
class Tab2 {
constructor(public nav: NavController) {}
}
class Tab2 {}
//
// Tab 3
@ -58,9 +54,7 @@ class Tab2 {
</ion-content>
`
})
class Tab3 {
constructor(public nav: NavController) {}
}
class Tab3 {}
//
// Tab 3
@ -80,9 +74,7 @@ class Tab3 {
</ion-content>
`
})
class QuesaritoPage {
constructor(public nav: NavController) {}
}
class QuesaritoPage {}
@Component({
template: `

View File

@ -22,7 +22,7 @@ class AnotherPage {}
})
class E2EPage {
constructor(private toastCtrl: ToastController, private nav: NavController) { }
constructor(public toastCtrl: ToastController, public navCtrl: NavController) { }
showToast() {
const toast = this.toastCtrl.create({
@ -36,7 +36,7 @@ class E2EPage {
toast.present();
setTimeout(() => {
this.nav.push(AnotherPage);
this.navCtrl.push(AnotherPage);
}, 1000);
setTimeout(() => {

View File

@ -8,7 +8,7 @@ import { NavController } from 'ionic-angular';
})
export class <%= jsClassName %> {
constructor(private nav: NavController) {
constructor(public navCtrl: NavController) {
// set the root pages for each tab
<% _.forEach(tabs, function(tab, i) { %>this.tab<%= ++i %>Root = <%= tab.jsClassName %>;
<% }); %>