diff --git a/ionic/components/nav/test/basic/pages/first-page.js b/ionic/components/nav/test/basic/pages/first-page.js index f612bd4110..76debd24a3 100644 --- a/ionic/components/nav/test/basic/pages/first-page.js +++ b/ionic/components/nav/test/basic/pages/first-page.js @@ -1,7 +1,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; import {View} from 'angular2/src/core/annotations_impl/view'; -import {Routable, NavController, NavbarTemplate, Navbar, NavPush, Content} from 'ionic/ionic'; +import {Routable, Router, NavController, NavbarTemplate, Navbar, NavPush, Content} from 'ionic/ionic'; import {SecondPage} from './second-page'; @@ -35,7 +35,7 @@ export class FirstPage { this.nav = nav; this.val = Math.round(Math.random() * 8999) + 1000; - FirstPage.router.invoke(this); + this.router = FirstPage.router.invoke(this); this.pushPage = SecondPage; this.pushData = { @@ -53,6 +53,7 @@ export class FirstPage { viewDidEnter() { console.log('viewDidEnter first page'); + Router.emit(this.router.routeInfo.url); } viewWillLeave() { diff --git a/ionic/components/nav/test/basic/pages/second-page.js b/ionic/components/nav/test/basic/pages/second-page.js index d7054f29e3..b00b536033 100644 --- a/ionic/components/nav/test/basic/pages/second-page.js +++ b/ionic/components/nav/test/basic/pages/second-page.js @@ -1,7 +1,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; import {View} from 'angular2/src/core/annotations_impl/view'; -import {Routable, NavController, NavPop, NavParams, NavbarTemplate, Navbar, Content} from 'ionic/ionic'; +import {Routable, Router, NavController, NavPop, NavParams, NavbarTemplate, Navbar, Content} from 'ionic/ionic'; import {ThirdPage} from './third-page'; @@ -36,7 +36,7 @@ export class SecondPage { this.params = params; this.val = Math.round(Math.random() * 8999) + 1000; - SecondPage.router.invoke(this); + this.router = SecondPage.router.invoke(this); console.log('Second page params:', params); } @@ -59,6 +59,7 @@ export class SecondPage { viewDidEnter() { console.log('viewDidEnter second page'); + Router.emit(this.router.routeInfo.url); } viewWillLeave() { diff --git a/ionic/routing/router.js b/ionic/routing/router.js index c6b4a9005e..911b2428f9 100644 --- a/ionic/routing/router.js +++ b/ionic/routing/router.js @@ -6,6 +6,7 @@ export class RouterController { constructor() { this.routes = [] + console.log('Router controller built'); } // Build route params to send to the matching route. @@ -164,8 +165,10 @@ export class Routable { } invoke(componentInstance) { console.log('Routable invoke', componentInstance); - Router.emit(this.routeInfo.url); + + return this; } + } var Router = new RouterController();