mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
router wip
This commit is contained in:
@@ -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',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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: '' +
|
||||
|
||||
@@ -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'
|
||||
// })
|
||||
|
||||
@@ -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'
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user