diff --git a/ionic/components/nav/test/basic/pages/first-page.js b/ionic/components/nav/test/basic/pages/first-page.js index c956c35b48..f612bd4110 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 {NavController, NavbarTemplate, Navbar, NavPush, Content} from 'ionic/ionic'; +import {Routable, NavController, NavbarTemplate, Navbar, NavPush, Content} from 'ionic/ionic'; import {SecondPage} from './second-page'; @@ -35,6 +35,8 @@ export class FirstPage { this.nav = nav; this.val = Math.round(Math.random() * 8999) + 1000; + FirstPage.router.invoke(this); + this.pushPage = SecondPage; this.pushData = { id: 420 @@ -81,3 +83,7 @@ export class FirstPage { this.nav.push(SecondPage, { id: 8675309, myData: [1,2,3,4] }, { animation: 'ios' }); } } + +new Routable(FirstPage, { + url: '/first-page' +}) diff --git a/ionic/routing/router.js b/ionic/routing/router.js index 675f6944b8..c6b4a9005e 100644 --- a/ionic/routing/router.js +++ b/ionic/routing/router.js @@ -158,7 +158,13 @@ export class Routable { this.componentClass = componentClass; this.routeInfo = routeInfo; - componentClass._route = this; + console.log('New routable', componentClass, routeInfo); + + componentClass.router = this; + } + invoke(componentInstance) { + console.log('Routable invoke', componentInstance); + Router.emit(this.routeInfo.url); } }