mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(e2e): refactor e2e to use deeplink decorator, lazy load more pages
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class E2EApp {
|
||||
root = 'E2EPage';
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
|
||||
@@ -2,23 +2,18 @@ import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../..';
|
||||
|
||||
import { E2EApp } from './app.component';
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
E2EApp
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(E2EApp, {}, {
|
||||
links: [
|
||||
{ loadChildren: '../pages/main/main.module#E2EPageModule', name: 'E2EPage' },
|
||||
]
|
||||
})
|
||||
IonicModule.forRoot(AppComponent, {}),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
E2EApp
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DeepLinkModule } from '../../../../../..';
|
||||
|
||||
import { E2EPage } from './main';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
E2EPage,
|
||||
],
|
||||
imports: [
|
||||
DeepLinkModule.forChild(E2EPage)
|
||||
],
|
||||
entryComponents: [
|
||||
E2EPage,
|
||||
]
|
||||
})
|
||||
export class E2EPageModule {}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DeepLinkModule } from '../../../../../..';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
DeepLinkModule.forChild(PageOne)
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
import { NavController, PickerController } from '../../../../../..';
|
||||
import { DeepLink, NavController, PickerController } from '../../../../../..';
|
||||
|
||||
@DeepLink()
|
||||
@Component({
|
||||
templateUrl: 'main.html',
|
||||
templateUrl: 'page-one.html',
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
})
|
||||
export class E2EPage {
|
||||
export class PageOne {
|
||||
smoothie: string;
|
||||
timer: string;
|
||||
|
||||
@@ -16,7 +17,7 @@ export class E2EPage {
|
||||
) { }
|
||||
|
||||
push() {
|
||||
this.navCtrl.push(E2EPage);
|
||||
this.navCtrl.push(PageOne);
|
||||
}
|
||||
|
||||
twoColumns() {
|
||||
Reference in New Issue
Block a user