-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(navigation): account for condition of toggling one view with tabs…
… to another view with tabs
- Loading branch information
1 parent
2bd89fe
commit c963745
Showing
57 changed files
with
1,164 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { NavController } from '../../../../..'; | ||
@Component({ | ||
template: ` | ||
<ion-menu [content]="content"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Menu</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<ion-list> | ||
<button ion-item (click)="goToTabsOne()" menuClose> | ||
Page One | ||
</button> | ||
<button ion-item (click)="goToTabsTwo()" menuClose> | ||
Page Four | ||
</button> | ||
</ion-list> | ||
</ion-content> | ||
</ion-menu> | ||
<ion-nav [root]="root" #content name="rootNav"></ion-nav>` | ||
}) | ||
export class AppComponent { | ||
root = 'RootPage'; | ||
|
||
@ViewChild('content') nav: NavController; | ||
|
||
goToTabsOne() { | ||
this.nav.setRoot('FirstPage'); | ||
} | ||
|
||
goToTabsTwo() { | ||
this.nav.setRoot('FourthPage'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { IonicApp, IonicModule } from '../../../../..'; | ||
|
||
import { AppComponent } from './app.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
AppComponent | ||
], | ||
imports: [ | ||
BrowserModule, | ||
IonicModule.forRoot(AppComponent, { swipeBackEnabled: true, preloadModules: true }), | ||
], | ||
bootstrap: [IonicApp] | ||
}) | ||
export class AppModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
|
||
import { AppModule } from './app.module'; | ||
|
||
platformBrowserDynamic().bootstrapModule(AppModule); |
18 changes: 18 additions & 0 deletions
18
src/components/nav/test/toggle-basic/pages/fifth-page/fifth-page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<ion-header> | ||
<ion-navbar> | ||
<button ion-button menuToggle> | ||
<ion-icon name="menu"></ion-icon> | ||
</button> | ||
<ion-title>Fifth Page</ion-title> | ||
</ion-navbar> | ||
</ion-header> | ||
<ion-content> | ||
Fifth Page | ||
<div> | ||
User ID: {{userId}} | ||
</div> | ||
<div> | ||
Name {{name}} | ||
</div> | ||
<button ion-button (click)="goToNextPage()">Next Page</button> | ||
</ion-content> |
13 changes: 13 additions & 0 deletions
13
src/components/nav/test/toggle-basic/pages/fifth-page/fifth-page.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { IonicPageModule } from '../../../../../..'; | ||
import { FifthPage } from './fifth-page'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
IonicPageModule.forChild(FifthPage) | ||
], | ||
declarations: [ | ||
FifthPage | ||
] | ||
}) | ||
export class FifthPageModule { } |
22 changes: 22 additions & 0 deletions
22
src/components/nav/test/toggle-basic/pages/fifth-page/fifth-page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component } from '@angular/core'; | ||
import { IonicPage, NavController, NavParams } from '../../../../../..'; | ||
|
||
@IonicPage({ | ||
segment: 'fifthPage/user/:userId/name/:name' | ||
}) | ||
@Component({ | ||
templateUrl: 'fifth-page.html' | ||
}) | ||
export class FifthPage { | ||
|
||
userId: string; | ||
name: string; | ||
constructor(public nav: NavController, public params: NavParams) { | ||
this.userId = this.params.data.userId; | ||
this.name = this.params.data.name; | ||
} | ||
|
||
goToNextPage() { | ||
this.nav.push('SixthPage', { paramOne: 'Kelly Kapore', paramTwo: 'Creed Bratton'}); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/components/nav/test/toggle-basic/pages/first-page/first-page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<ion-header> | ||
<ion-navbar> | ||
<button ion-button menuToggle> | ||
<ion-icon name="menu"></ion-icon> | ||
</button> | ||
<ion-title>First Page</ion-title> | ||
</ion-navbar> | ||
</ion-header> | ||
<ion-content> | ||
First Page | ||
<div> | ||
<button ion-button (click)="clickMe()">Go To Next Page</button> | ||
</div> | ||
</ion-content> |
13 changes: 13 additions & 0 deletions
13
src/components/nav/test/toggle-basic/pages/first-page/first-page.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { IonicPageModule } from '../../../../../..'; | ||
import { FirstPage } from './first-page'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
IonicPageModule.forChild(FirstPage) | ||
], | ||
declarations: [ | ||
FirstPage | ||
] | ||
}) | ||
export class FirstPageModule { } |
15 changes: 15 additions & 0 deletions
15
src/components/nav/test/toggle-basic/pages/first-page/first-page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component } from '@angular/core'; | ||
import { IonicPage, NavController, } from '../../../../../..'; | ||
|
||
@IonicPage() | ||
@Component({ | ||
templateUrl: 'first-page.html' | ||
}) | ||
export class FirstPage { | ||
constructor(public nav: NavController) { | ||
} | ||
|
||
clickMe() { | ||
this.nav.push('SecondPage', { userId: '123', name: 'Phyllis Vance, Vance Refridgeration'}); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/components/nav/test/toggle-basic/pages/fourth-page/fourth-page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<ion-header> | ||
<ion-navbar> | ||
<button ion-button menuToggle> | ||
<ion-icon name="menu"></ion-icon> | ||
</button> | ||
<ion-title>Fourth Page</ion-title> | ||
</ion-navbar> | ||
</ion-header> | ||
<ion-content> | ||
Fourth Page | ||
<div> | ||
<button ion-button (click)="clickMe()">Go To Next Page</button> | ||
</div> | ||
</ion-content> |
13 changes: 13 additions & 0 deletions
13
src/components/nav/test/toggle-basic/pages/fourth-page/fourth-page.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { IonicPageModule } from '../../../../../..'; | ||
import { FourthPage } from './fourth-page'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
IonicPageModule.forChild(FourthPage) | ||
], | ||
declarations: [ | ||
FourthPage | ||
] | ||
}) | ||
export class FourthPageModule { } |
15 changes: 15 additions & 0 deletions
15
src/components/nav/test/toggle-basic/pages/fourth-page/fourth-page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component } from '@angular/core'; | ||
import { IonicPage, NavController, } from '../../../../../..'; | ||
|
||
@IonicPage() | ||
@Component({ | ||
templateUrl: 'fourth-page.html' | ||
}) | ||
export class FourthPage { | ||
constructor(public nav: NavController) { | ||
} | ||
|
||
clickMe() { | ||
this.nav.push('FifthPage', { userId: '456', name: 'Ryan Howard'}); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/components/nav/test/toggle-basic/pages/root-page/root-page.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { IonicPageModule } from '../../../../../..'; | ||
import { RootPage } from './root-page'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
IonicPageModule.forChild(RootPage) | ||
], | ||
declarations: [ | ||
RootPage | ||
] | ||
}) | ||
export class RootPageModule { } |
25 changes: 25 additions & 0 deletions
25
src/components/nav/test/toggle-basic/pages/root-page/root-page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component } from '@angular/core'; | ||
import { IonicPage, NavController, } from '../../../../../..'; | ||
|
||
@IonicPage() | ||
@Component({ | ||
template: ` | ||
<ion-header> | ||
<ion-navbar> | ||
<button ion-button menuToggle> | ||
<ion-icon name="menu"></ion-icon> | ||
</button> | ||
<ion-title>Root Page</ion-title> | ||
</ion-navbar> | ||
</ion-header> | ||
<ion-content> | ||
Root Page | ||
<button ion-button secondary menuToggle>Toggle Menu</button> | ||
</ion-content> | ||
` | ||
}) | ||
export class RootPage { | ||
|
||
constructor(public nav: NavController) { | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/components/nav/test/toggle-basic/pages/second-page/second-page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<ion-header> | ||
<ion-navbar> | ||
<button ion-button menuToggle> | ||
<ion-icon name="menu"></ion-icon> | ||
</button> | ||
<ion-title>Second Page</ion-title> | ||
</ion-navbar> | ||
</ion-header> | ||
<ion-content> | ||
<div> | ||
User ID: {{userId}} | ||
</div> | ||
<div> | ||
Name {{name}} | ||
</div> | ||
<button ion-button (click)="goToNextPage()">Next Page</button> | ||
</ion-content> |
13 changes: 13 additions & 0 deletions
13
src/components/nav/test/toggle-basic/pages/second-page/second-page.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { IonicPageModule } from '../../../../../..'; | ||
import { SecondPage } from './second-page'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
IonicPageModule.forChild(SecondPage) | ||
], | ||
declarations: [ | ||
SecondPage | ||
] | ||
}) | ||
export class SecondPageModule { } |
22 changes: 22 additions & 0 deletions
22
src/components/nav/test/toggle-basic/pages/second-page/second-page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component } from '@angular/core'; | ||
import { IonicPage, NavController, NavParams } from '../../../../../..'; | ||
|
||
@IonicPage({ | ||
segment: 'secondPage/user/:userId/name/:name' | ||
}) | ||
@Component({ | ||
templateUrl: 'second-page.html' | ||
}) | ||
export class SecondPage { | ||
|
||
userId: string; | ||
name: string; | ||
constructor(public nav: NavController, public params: NavParams) { | ||
this.userId = this.params.data.userId; | ||
this.name = this.params.data.name; | ||
} | ||
|
||
goToNextPage() { | ||
this.nav.push('ThirdPage', { paramOne: 'Tobey', paramTwo: 'Kevin'}); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/components/nav/test/toggle-basic/pages/sixth-page/sixth-page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<ion-header> | ||
<ion-navbar> | ||
<button ion-button menuToggle> | ||
<ion-icon name="menu"></ion-icon> | ||
</button> | ||
<ion-title>Sixth Page</ion-title> | ||
</ion-navbar> | ||
</ion-header> | ||
<ion-content> | ||
<h2>Sixth Page</h2> | ||
<div> | ||
Param One: {{paramOne}} | ||
</div> | ||
<div> | ||
Param Two: {{paramTwo}} | ||
</div> | ||
</ion-content> |
13 changes: 13 additions & 0 deletions
13
src/components/nav/test/toggle-basic/pages/sixth-page/sixth-page.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { IonicPageModule } from '../../../../../..'; | ||
import { SixthPage } from './sixth-page'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
IonicPageModule.forChild(SixthPage) | ||
], | ||
declarations: [ | ||
SixthPage | ||
] | ||
}) | ||
export class SixthPageModule { } |
19 changes: 19 additions & 0 deletions
19
src/components/nav/test/toggle-basic/pages/sixth-page/sixth-page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component } from '@angular/core'; | ||
import { IonicPage, NavController, NavParams } from '../../../../../..'; | ||
|
||
@IonicPage({ | ||
segment: 'sixthPage/paramOne/:paramOne/paramTwo/:paramTwo' | ||
}) | ||
@Component({ | ||
templateUrl: 'sixth-page.html' | ||
}) | ||
export class SixthPage { | ||
|
||
paramOne: string; | ||
paramTwo: string; | ||
|
||
constructor(public nav: NavController, public params: NavParams) { | ||
this.paramOne = this.params.data.paramOne; | ||
this.paramTwo = this.params.data.paramTwo; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/components/nav/test/toggle-basic/pages/third-page/third-page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<ion-header> | ||
<ion-navbar> | ||
<button ion-button menuToggle> | ||
<ion-icon name="menu"></ion-icon> | ||
</button> | ||
<ion-title>Third Page</ion-title> | ||
</ion-navbar> | ||
</ion-header> | ||
<ion-content> | ||
<h2>Third Page</h2> | ||
<div> | ||
Param One: {{paramOne}} | ||
</div> | ||
<div> | ||
Param Two: {{paramTwo}} | ||
</div> | ||
</ion-content> |
13 changes: 13 additions & 0 deletions
13
src/components/nav/test/toggle-basic/pages/third-page/third-page.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { IonicPageModule } from '../../../../../..'; | ||
import { ThirdPage } from './third-page'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
IonicPageModule.forChild(ThirdPage) | ||
], | ||
declarations: [ | ||
ThirdPage | ||
] | ||
}) | ||
export class ThirdPageModule { } |
Oops, something went wrong.