Skip to content

Commit

Permalink
test(): update to public navCtrl convention
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Aug 4, 2016
1 parent 478ac45 commit 3c49365
Show file tree
Hide file tree
Showing 36 changed files with 154 additions and 145 deletions.
8 changes: 4 additions & 4 deletions demos/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -113,18 +113,18 @@ export class ApiDemoPage {
}

push() {
this.nav.push(PushPage);
this.navCtrl.push(PushPage);
}
}

@Component({
templateUrl: 'page.html'
})
export class PushPage {
constructor(public nav: NavController) {}
constructor(public navCtrl: NavController) {}

pop() {
this.nav.pop();
this.navCtrl.pop();
}
}

Expand Down
2 changes: 1 addition & 1 deletion demos/item-reorder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions demos/loading/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -100,7 +100,7 @@ class Page1 {
loading.present();

setTimeout(() => {
this.nav.push(Page2);
this.navCtrl.push(Page2);
}, 1000);

setTimeout(() => {
Expand Down
1 change: 0 additions & 1 deletion demos/modal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class ModalContentPage {
myParam: string;

constructor(
public nav: NavController,
public viewCtrl: ViewController,
params: NavParams
) {
Expand Down
6 changes: 3 additions & 3 deletions demos/nav-params/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}

Expand All @@ -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');
}
}
Expand Down
10 changes: 5 additions & 5 deletions demos/navigation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/action-sheet/action-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
10 changes: 5 additions & 5 deletions src/components/alert/test/dismiss/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -26,7 +26,7 @@ export class E2EPage {

alert.onDidDismiss(() => {
console.log('dismiss');
this.nav.push(AnotherPage);
this.navCtrl.push(AnotherPage);
});

alert.present();
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -98,7 +98,7 @@ class AnotherPage {
role: 'cancel',
handler: () => {
alert.dismiss().then(() => {
this.nav.pop();
this.navCtrl.pop();
});
return false;
}
Expand Down Expand Up @@ -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);

Expand Down
20 changes: 9 additions & 11 deletions src/components/app/test/cordova/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class OtherData {
`
})
class MyModal {
constructor(private viewCtrl: ViewController) {}
constructor(public viewCtrl: ViewController) {}

dismissModal() {
this.viewCtrl.dismiss();
Expand All @@ -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);
}
}

Expand All @@ -78,7 +78,7 @@ class Page2 {
page1 = Page1;
page3 = Page3;

constructor(private modalCtrl: ModalController) {}
constructor(public modalCtrl: ModalController) {}

openModal() {
this.modalCtrl.create(MyModal).present();
Expand All @@ -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();
}
}

Expand All @@ -118,9 +118,7 @@ class Page3 {
</ion-content>
`
})
class TabPage1 {
constructor(private nav: NavController) {}
}
class TabPage1 {}


@Component({
Expand All @@ -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();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/app/test/gesture-collision/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -19,7 +19,7 @@ class Page1 {
}

goToPage1() {
this.nav.push(Page1);
this.navCtrl.push(Page1);
}

doRefresh(refresher: Refresher) {
Expand Down
8 changes: 4 additions & 4 deletions src/components/infinite-scroll/test/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand All @@ -35,7 +35,7 @@ class E2EPage1 {
}

goToPage2() {
this.nav.push(E2EPage2);
this.navCtrl.push(E2EPage2);
}

toggleInfiniteScroll() {
Expand All @@ -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) {}
}


Expand Down
8 changes: 4 additions & 4 deletions src/components/item/test/groups/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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() {
Expand Down
14 changes: 7 additions & 7 deletions src/components/loading/test/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -99,7 +99,7 @@ class E2EPage {
loading.present();

setTimeout(() => {
this.nav.push(Page2);
this.navCtrl.push(Page2);
}, 1000);

setTimeout(() => {
Expand All @@ -108,7 +108,7 @@ class E2EPage {
}

goToPage2() {
this.nav.push(Page2);
this.navCtrl.push(Page2);
}

presentLoadingMultiple() {
Expand Down Expand Up @@ -180,7 +180,7 @@ class E2EPage {
loading3.present();

setTimeout(() => {
this.nav.push(Page2);
this.navCtrl.push(Page2);
}, 1000);
}, 1000);
}
Expand All @@ -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);
}
}

Expand Down
Loading

0 comments on commit 3c49365

Please sign in to comment.