Skip to content

Commit f39c381

Browse files
committed
fix(navigation): add isTab check to getSegmentsFromNav
1 parent 6f7acdb commit f39c381

19 files changed

Lines changed: 304 additions & 1 deletion

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
template: `<ion-nav [root]="root"></ion-nav>`
5+
})
6+
export class AppComponent {
7+
root = 'SecondNav';
8+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { IonicApp, IonicModule } from '../../../../..';
4+
5+
import { AppComponent } from './app.component';
6+
7+
@NgModule({
8+
declarations: [
9+
AppComponent
10+
],
11+
imports: [
12+
BrowserModule,
13+
IonicModule.forRoot(AppComponent, { swipeBackEnabled: true, preloadModules: true }),
14+
],
15+
bootstrap: [IonicApp]
16+
})
17+
export class AppModule {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2+
3+
import { AppModule } from './app.module';
4+
5+
platformBrowserDynamic().bootstrapModule(AppModule);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NgModule } from '@angular/core';
2+
import { IonicPageModule } from '../../../../../..';
3+
import { FirstPage } from './first-page';
4+
5+
@NgModule({
6+
imports: [
7+
IonicPageModule.forChild(FirstPage)
8+
],
9+
declarations: [
10+
FirstPage
11+
]
12+
})
13+
export class FirstPageModule { }
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Component } from '@angular/core';
2+
import { IonicPage, NavController } from '../../../../../..';
3+
4+
@IonicPage()
5+
@Component({
6+
selector: 'page-home',
7+
template: `
8+
<ion-header>
9+
<ion-navbar>
10+
<ion-title>Tab 1</ion-title>
11+
</ion-navbar>
12+
</ion-header>
13+
<ion-content>
14+
<button ion-button (click)="goToNextPage()">Go to Next Page</button>
15+
</ion-content>
16+
`
17+
})
18+
export class FirstPage {
19+
20+
constructor(public navCtrl: NavController) {
21+
22+
}
23+
24+
goToNextPage() {
25+
this.navCtrl.push('ThirdNav');
26+
}
27+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NgModule } from '@angular/core';
2+
import { IonicPageModule } from '../../../../../..';
3+
import { HomePage } from './home';
4+
5+
@NgModule({
6+
imports: [
7+
IonicPageModule.forChild(HomePage)
8+
],
9+
declarations: [
10+
HomePage
11+
]
12+
})
13+
export class HomePageModule { }
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
page-home {
2+
3+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Component } from '@angular/core';
2+
import { IonicPage, NavController } from '../../../../../..';
3+
4+
@IonicPage()
5+
@Component({
6+
selector: 'page-home',
7+
template: `
8+
<ion-header>
9+
<ion-navbar>
10+
<ion-title>
11+
Ionic Blank
12+
</ion-title>
13+
</ion-navbar>
14+
</ion-header>
15+
16+
<ion-content padding>
17+
The world is your oyster.
18+
<p>
19+
If you get lost, the <a href="http://ionicframework.com/docs/v2">docs</a> will be your guide.
20+
</p>
21+
<button ion-button (click)="clickMe()">Go to Tabs</button>
22+
</ion-content>
23+
24+
`
25+
})
26+
export class HomePage {
27+
28+
constructor(public navCtrl: NavController) {
29+
30+
}
31+
32+
clickMe() {
33+
this.navCtrl.push('TabsPage', { paramOne: 'ParamOneData', paramTwo: 'ParamTwoData'});
34+
}
35+
36+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NgModule } from '@angular/core';
2+
import { IonicPageModule } from '../../../../../..';
3+
import { SecondNav } from './second-nav';
4+
5+
@NgModule({
6+
imports: [
7+
IonicPageModule.forChild(SecondNav)
8+
],
9+
declarations: [
10+
SecondNav
11+
]
12+
})
13+
export class SecondNavModule { }
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Component } from '@angular/core';
2+
import { IonicPage, NavController } from '../../../../../..';
3+
4+
@IonicPage()
5+
@Component({
6+
selector: 'page-home',
7+
template: `
8+
<ion-nav [root]="rootPage"></ion-nav>
9+
10+
`
11+
})
12+
export class SecondNav {
13+
14+
rootPage:any = 'HomePage';
15+
constructor(public navCtrl: NavController) {
16+
17+
}
18+
19+
}

0 commit comments

Comments
 (0)