@@ -6,8 +6,7 @@ import {Ion} from '../ion';
66import { IonicApp } from '../app/app' ;
77import { Keyboard } from '../../util/keyboard' ;
88import { NavParams } from './nav-params' ;
9- import { NavRouter } from './nav-router' ;
10- import { pascalCaseToDashCase , isTrueProperty , isBlank } from '../../util/util' ;
9+ import { pascalCaseToDashCase , isBlank } from '../../util/util' ;
1110import { Portal } from './nav-portal' ;
1211import { raf } from '../../util/dom' ;
1312import { SwipeBackGesture } from './swipe-back' ;
@@ -131,7 +130,7 @@ export class NavController extends Ion {
131130 /**
132131 * @private
133132 */
134- router : NavRouter ;
133+ routers : any [ ] = [ ] ;
135134
136135 /**
137136 * @private
@@ -1254,9 +1253,12 @@ export class NavController extends Ion {
12541253 this . _app && this . _app . setEnabled ( true ) ;
12551254 this . setTransitioning ( false ) ;
12561255
1257- if ( this . router && direction !== null && hasCompleted ) {
1256+ if ( direction !== null && hasCompleted && this . _portal ) {
12581257 // notify router of the state change if a direction was provided
1259- this . router . stateChange ( direction , enteringView ) ;
1258+ // multiple routers can exist and each should be notified
1259+ this . routers . forEach ( router => {
1260+ router . stateChange ( direction , enteringView ) ;
1261+ } ) ;
12601262 }
12611263
12621264 // see if we should add the swipe back gesture listeners or not
@@ -1630,10 +1632,9 @@ export class NavController extends Ion {
16301632
16311633 /**
16321634 * @private
1633- * @param {TODO } router TODO
16341635 */
1635- registerRouter ( router ) {
1636- this . router = router ;
1636+ registerRouter ( router : any ) {
1637+ this . routers . push ( router ) ;
16371638 }
16381639
16391640 /**
0 commit comments