router wip

This commit is contained in:
Adam Bradley
2015-06-29 15:59:50 -05:00
parent 5a77e0c5b9
commit 6f3dd4eb7d
7 changed files with 89 additions and 53 deletions

View File

@@ -22,11 +22,11 @@ export function main(ionicBootstrap) {
},
'SecondPage': {
'path': '/secondpage',
'module': './second-page'
'module': 'dist/examples/nav/basic/pages/second-page',
},
'ThirdPage': {
'path': '/thirdpage',
'module': './third-page'
'module': 'dist/examples/nav/basic/pages/third-page',
},
});

View File

@@ -1,12 +1,14 @@
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
import {IonicView, IonicConfig, IonicApp} from 'ionic/ionic';
import {NavParams, Routable, Router_OLD, NavController} from 'ionic/ionic';
import {IonicComponent, IonicView, IonicConfig, IonicApp} from 'ionic/ionic';
import {NavParams, NavController} from 'ionic/ionic';
import {SecondPage} from './second-page'
@Component({
selector: 'ion-view'
@IonicComponent({
selector: 'ion-view',
route: {
path: '/firstpage'
}
})
@IonicView({
template: '' +

View File

@@ -1,10 +1,13 @@
import {Component} from 'angular2/src/core/annotations_impl/annotations';
import {IonicView, Routable, Router_OLD, NavController, NavParams} from 'ionic/ionic';
import {IonicComponent, IonicView, NavController, NavParams} from 'ionic/ionic';
import {ThirdPage} from './third-page';
@Component({selector: 'ion-view'})
@IonicComponent({
selector: 'ion-view',
route: {
path: '/secondpage'
}
})
@IonicView({
template: `
<ion-navbar *navbar><ion-title>Second Page Header</ion-title></ion-navbar>
@@ -30,9 +33,6 @@ export class SecondPage {
nav: NavController,
params: NavParams
) {
// TODO: Shouldn't have to do this
Router_OLD.setNavController(nav);
this.nav = nav;
this.params = params;
this.val = Math.round(Math.random() * 8999) + 1000;
@@ -50,7 +50,6 @@ export class SecondPage {
viewLoaded() {
console.log('viewLoaded second page');
this.router = SecondPage.router.invoke(this);
}
viewWillEnter() {
@@ -87,6 +86,6 @@ export class SecondPage {
}
new Routable(SecondPage, {
url: '/second-page'
})
// new Routable(SecondPage, {
// url: '/second-page'
// })

View File

@@ -1,9 +1,12 @@
import {Component} from 'angular2/src/core/annotations_impl/annotations';
import {IonicView, Router_OLD, Routable, NavController} from 'ionic/ionic';
import {IonicComponent, IonicView, NavController} from 'ionic/ionic';
@Component({selector: 'ion-view'})
@IonicComponent({
selector: 'ion-view',
route: {
path: '/thirdpage'
}
})
@IonicView({
template: `
<ion-navbar *navbar><ion-title>Third Page Header</ion-title></ion-navbar>
@@ -20,9 +23,6 @@ export class ThirdPage {
nav: NavController
) {
this.nav = nav
// TODO: Shouldn't have to do this
Router_OLD.setNavController(nav);
}
pop() {
@@ -30,7 +30,6 @@ export class ThirdPage {
}
viewLoaded() {
this.router = ThirdPage.router.invoke(this);
console.log('viewLoaded third page');
}
@@ -69,6 +68,6 @@ export class ThirdPage {
}
new Routable(ThirdPage, {
url: '/third-page'
})
// new Routable(ThirdPage, {
// url: '/third-page'
// })