@@ -6,8 +6,7 @@ import {Ion} from '../ion';
6
6
import { IonicApp } from '../app/app' ;
7
7
import { Keyboard } from '../../util/keyboard' ;
8
8
import { 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' ;
11
10
import { Portal } from './nav-portal' ;
12
11
import { raf } from '../../util/dom' ;
13
12
import { SwipeBackGesture } from './swipe-back' ;
@@ -131,7 +130,7 @@ export class NavController extends Ion {
131
130
/**
132
131
* @private
133
132
*/
134
- router : NavRouter ;
133
+ routers : any [ ] = [ ] ;
135
134
136
135
/**
137
136
* @private
@@ -1254,9 +1253,12 @@ export class NavController extends Ion {
1254
1253
this . _app && this . _app . setEnabled ( true ) ;
1255
1254
this . setTransitioning ( false ) ;
1256
1255
1257
- if ( this . router && direction !== null && hasCompleted ) {
1256
+ if ( direction !== null && hasCompleted && this . _portal ) {
1258
1257
// 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
+ } ) ;
1260
1262
}
1261
1263
1262
1264
// see if we should add the swipe back gesture listeners or not
@@ -1630,10 +1632,9 @@ export class NavController extends Ion {
1630
1632
1631
1633
/**
1632
1634
* @private
1633
- * @param {TODO } router TODO
1634
1635
*/
1635
- registerRouter ( router ) {
1636
- this . router = router ;
1636
+ registerRouter ( router : any ) {
1637
+ this . routers . push ( router ) ;
1637
1638
}
1638
1639
1639
1640
/**
0 commit comments