test(e2e): refactor e2e to use deeplink decorator, lazy load more pages

This commit is contained in:
Dan Bucholtz
2017-03-11 00:15:38 -06:00
committed by GitHub
parent 3118bbbd1b
commit 0964c850d4
290 changed files with 2083 additions and 1865 deletions

View File

@ -25,15 +25,15 @@
"link": "gulp release.prepareReleasePackage && cd dist/ionic-angular && npm link"
},
"dependencies": {
"@angular/common": "4.0.0-rc.2",
"@angular/compiler": "4.0.0-rc.2",
"@angular/compiler-cli": "4.0.0-rc.2",
"@angular/core": "4.0.0-rc.2",
"@angular/forms": "4.0.0-rc.2",
"@angular/http": "4.0.0-rc.2",
"@angular/platform-browser": "4.0.0-rc.2",
"@angular/platform-browser-dynamic": "4.0.0-rc.2",
"@angular/platform-server": "4.0.0-rc.2",
"@angular/common": "4.0.0-rc.3",
"@angular/compiler": "4.0.0-rc.3",
"@angular/compiler-cli": "4.0.0-rc.3",
"@angular/core": "4.0.0-rc.3",
"@angular/forms": "4.0.0-rc.3",
"@angular/http": "4.0.0-rc.3",
"@angular/platform-browser": "4.0.0-rc.3",
"@angular/platform-browser-dynamic": "4.0.0-rc.3",
"@angular/platform-server": "4.0.0-rc.3",
"ionicons": "~3.0.0",
"rxjs": "5.1.1",
"zone.js": "^0.7.2"

View File

@ -1,5 +1,5 @@
import { fork, ChildProcess } from 'child_process';
import { join } from 'path';
import { dirname, join } from 'path';
import { MessageToWorker, WorkerProcess } from './interfaces';
@ -55,11 +55,15 @@ export function createWorker(msg: MessageToWorker): any {
}
}
// default it to use the test/basic, or test/xyz directory
const deepLinksDir = dirname(dirname(msg.appNgModulePath));
try {
let scriptArgs = [
'build',
'--appEntryPoint', msg.appEntryPoint,
'--appNgModulePath', msg.appNgModulePath,
'--deepLinksDir', deepLinksDir,
'--srcDir', msg.srcDir,
'--wwwDir', msg.distDir,
'--tsconfig', msg.tsConfig,

View File

@ -12,11 +12,7 @@ import { PageOneModule } from '../pages/page-one/page-one.module';
],
imports: [
BrowserModule,
IonicModule.forRoot(AppComponent, {}, {
links: [
{ loadChildren: '../pages/modal-page/modal-page.module#ModalPageModule', name: 'modal-page' }
]
}),
IonicModule.forRoot(AppComponent, {}),
ModalPageModule,
PageOneModule
],

View File

@ -1,6 +1,9 @@
import { Component } from '@angular/core';
import { ViewController } from '../../../../../..';
import { DeepLink, ViewController } from '../../../../../..';
@DeepLink({
name: 'modal-page'
})
@Component({
template: `
<ion-header>

View File

@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { ActionSheetController, AlertController, ModalController, Platform } from '../../../../../..';
import { ActionSheetController, AlertController, DeepLink, ModalController, Platform } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page-one.html'
})

View File

@ -11,11 +11,7 @@ import { PageOneModule } from '../pages/page-one/page-one.module';
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {}, {
links: [
{ loadChildren: '../pages/modal-page/modal-page.module#ModalPageModule', name: 'modal-page'}
]
}),
IonicModule.forRoot(E2EApp, {}),
PageOneModule
],
bootstrap: [IonicApp]

View File

@ -1,6 +1,9 @@
import { Component } from '@angular/core';
import { ViewController } from '../../../../../..';
import { DeepLink, ViewController } from '../../../../../..';
@DeepLink({
name: 'modal-page'
})
@Component({
template: `
<ion-header>

View File

@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { AlertController, ModalController } from '../../../../../..';
import { AlertController, DeepLink, ModalController } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page-one.html'
})

View File

@ -3,7 +3,6 @@ import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../..';
import { E2EApp } from './app.component';
import { PageOne } from '../pages/page-one/page-one';
import { PageOneModule } from '../pages/page-one/page-one.module';
@NgModule({
@ -12,16 +11,7 @@ import { PageOneModule } from '../pages/page-one/page-one.module';
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, { statusbarPadding: true }, {
links: [
{ name: 'page-one', component: PageOne },
{ name: 'page-two', loadChildren: '../pages/page-two/page-two.module#PageTwoModule'},
{ name: 'page-three', loadChildren: '../pages/page-three/page-three.module#PageThreeModule'},
{ name: 'tabs-page', loadChildren: '../pages/tabs/tabs-page.module#TabsPageModule'},
{ name: 'tabs-page-one', loadChildren: '../pages/tabs-page-one/tabs-page-one.module#TabsPageOneModule'},
{ name: 'modal-page', loadChildren: '../pages/modal/modal.module#ModalPageModule'}
]
}),
IonicModule.forRoot(E2EApp, { statusbarPadding: true }),
PageOneModule
],
bootstrap: [IonicApp],

View File

@ -1,6 +1,9 @@
import { Component } from '@angular/core';
import { ViewController } from '../../../../../..';
import { DeepLink, ViewController } from '../../../../../..';
@DeepLink({
name: 'modal-page'
})
@Component({
template: `
<ion-header>

View File

@ -1,9 +1,12 @@
import { Component } from '@angular/core';
import { NavController } from '../../../../../..';
import { DeepLink, NavController } from '../../../../../..';
import { SomeData } from './provider-one';
import { OtherData } from './provider-two';
@DeepLink({
name: 'page-one'
})
@Component({
templateUrl: 'page-one.html'
})

View File

@ -1,6 +1,9 @@
import { Component } from '@angular/core';
import { NavController } from '../../../../../..';
import { DeepLink, NavController } from '../../../../../..';
@DeepLink({
name: 'page-three'
})
@Component({
templateUrl: 'page-three.html'
})

View File

@ -1,6 +1,9 @@
import { Component } from '@angular/core';
import { ModalController } from '../../../../../..';
import { DeepLink, ModalController } from '../../../../../..';
@DeepLink({
name: 'page-two'
})
@Component({
templateUrl: 'page-two.html'
})

View File

@ -1,5 +1,9 @@
import { Component } from '@angular/core';
import { DeepLink } from '../../../../../..';
@DeepLink({
name: 'tabs-page-one'
})
@Component({
template: `
<ion-header>

View File

@ -1,6 +1,9 @@
import { Component } from '@angular/core';
import { NavController } from '../../../../../..';
import { DeepLink, NavController } from '../../../../../..';
@DeepLink({
name: 'tabs-page'
})
@Component({
templateUrl: 'tabs-page.html'
})

View File

@ -11,12 +11,7 @@ import { PageOneModule } from '../pages/page-one/page-one.module';
],
imports: [
BrowserModule,
IonicModule.forRoot(AppComponent, {}, {
links: [
{ name: 'page-one', loadChildren: '../pages/page-one/page-one.module#PageOneModule'},
{ name: 'page-two', loadChildren: '../pages/page-two/page-two.module#PageTwoModule'},
]
}),
IonicModule.forRoot(AppComponent, {}),
PageOneModule
],
bootstrap: [IonicApp],

View File

@ -1,7 +1,9 @@
import { Component, ViewChild } from '@angular/core';
import { MenuController, Nav } from '../../../../../..';
import { DeepLink, MenuController, Nav } from '../../../../../..';
@DeepLink({
name: 'page-one'
})
@Component({
templateUrl: 'page-one.html'
})

View File

@ -1,6 +1,9 @@
import { Component } from '@angular/core';
import { AlertController, NavController, Refresher } from '../../../../../..';
import { AlertController, DeepLink, NavController, Refresher } from '../../../../../..';
@DeepLink({
name: 'page-two'
})
@Component({
templateUrl: 'page-two.html'
})

View File

@ -0,0 +1,9 @@
import { Component } from '@angular/core';
import { SessionList } from '../pages/session-list/session-list';
@Component({
template: '<ion-nav [root]="root"></ion-nav>'
})
export class AppComponent {
root = SessionList;
}

View File

@ -1,35 +1,20 @@
import { Component, NgModule } from '@angular/core';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../..';
import { SessionList } from '../pages/session-list/session-list';
@Component({
template: '<ion-nav [root]="root"></ion-nav>'
})
export class E2EApp {
root = SessionList;
}
import { AppComponent } from './app.component';
import { SessionListModule } from '../pages/session-list/session-list.module';
@NgModule({
declarations: [
E2EApp,
SessionList
AppComponent
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {}, {
links: [
{ loadChildren: '../pages/session-detail/session-detail.module#SessionDetailModule', name: 'SessionDetail'}
]
})
IonicModule.forRoot(AppComponent, {}),
SessionListModule
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp,
SessionList
]
})
export class AppModule {}

View File

@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { NavController, NavParams } from '../../../../../..';
import { DeepLink, NavController, NavParams } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'session-detail.html'
})

View File

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { SessionList } from './session-list';
import { DeepLinkModule } from '../../../../../..';
@NgModule({
declarations: [
SessionList
],
imports: [
DeepLinkModule.forChild(SessionList)
]
})
export class SessionListModule {}

View File

@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { NavController } from '../../../../../..';
import { DeepLink, NavController } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'session-list.html'
})

View File

@ -1,9 +1,9 @@
import { Component } from '@angular/core';
import { E2EPage } from '../pages/e2e-page/e2e-page';
import { PageOne } from '../pages/page-one/page-one';
@Component({
template: '<ion-nav [root]="rootPage"></ion-nav>'
})
export class E2EApp {
rootPage = E2EPage;
export class AppComponent {
rootPage = PageOne;
}

View File

@ -2,26 +2,18 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../..';
import { E2EApp } from './app.component';
import { E2EPage } from '../pages/e2e-page/e2e-page';
import { AppComponent } from './app.component';
import { PageOneModule } from '../pages/page-one/page-one.module';
@NgModule({
declarations: [
E2EApp,
E2EPage
AppComponent
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {}, {
links: [
{ component: E2EPage, name: 'e2e-page' }
]
})
IonicModule.forRoot(AppComponent, {}),
PageOneModule
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp,
E2EPage
]
})
export class AppModule { }

View File

@ -1,17 +1,14 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { Page2 } from './page2';
import { PageOne } from './page-one';
@NgModule({
declarations: [
Page2,
PageOne,
],
imports: [
DeepLinkModule.forChild(Page2)
],
entryComponents: [
Page2,
DeepLinkModule.forChild(PageOne),
]
})
export class Page2Module {}
export class PageOneModule {}

View File

@ -1,5 +1,5 @@
import { Component } from '@angular/core';
@Component({
templateUrl: 'main.html'
templateUrl: 'page-one.html'
})
export class E2EPage { }
export class PageOne { }

View File

@ -1,8 +1,9 @@
import { Component } from '@angular/core';
import { E2EPage } from '../pages/e2e-page/e2e-page';
import { PageOne } from '../pages/page-one/page-one';
@Component({
template: '<ion-nav [root]="rootPage"></ion-nav>'
})
export class E2EApp {
rootPage = E2EPage;
export class AppComponent {
rootPage = PageOne;
}

View File

@ -2,26 +2,18 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../..';
import { E2EApp } from './app.component';
import { E2EPage } from '../pages/e2e-page/e2e-page';
import { AppComponent } from './app.component';
import { PageOneModule } from '../pages/page-one/page-one.module';
@NgModule({
declarations: [
E2EApp,
E2EPage
AppComponent,
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {}, {
links: [
{ component: E2EPage, name: 'e2e-page' }
]
})
IonicModule.forRoot(AppComponent, {}),
PageOneModule
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp,
E2EPage
]
})
export class AppModule { }

View File

@ -1,5 +0,0 @@
import { Component } from '@angular/core';
@Component({
templateUrl: 'main.html'
})
export class E2EPage { }

View File

@ -1,17 +1,14 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { Page2 } from './page2';
import { PageOne } from './page-one';
@NgModule({
declarations: [
Page2,
PageOne,
],
imports: [
DeepLinkModule.forChild(Page2)
],
entryComponents: [
Page2,
DeepLinkModule.forChild(PageOne),
]
})
export class Page2Module {}
export class PageOneModule {}

View File

@ -0,0 +1,8 @@
import { Component } from '@angular/core';
import { DeepLink } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page-one.html'
})
export class PageOne { }

View File

@ -1,10 +1,9 @@
import { Component } from '@angular/core';
import { E2EPage } from '../pages/e2e-page/e2e-page';
import { PageOne } from '../pages/page-one/page-one';
@Component({
template: '<ion-nav [root]="rootPage"></ion-nav>'
})
export class E2EApp {
rootPage = E2EPage;
export class AppComponent {
rootPage = PageOne;
}

View File

@ -1,27 +1,20 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../..';
import { E2EApp } from './app.component';
import { E2EPage } from '../pages/e2e-page/e2e-page';
import { AppComponent } from './app.component';
import { PageOneModule } from '../pages/page-one/page-one.module';
@NgModule({
declarations: [
E2EApp,
E2EPage
AppComponent
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {}, {
links: [
{ component: E2EPage, name: 'e2e-page' }
]
})
IonicModule.forRoot(AppComponent, {}),
PageOneModule
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp,
E2EPage
]
})
export class AppModule { }

View File

@ -1,6 +0,0 @@
import { Component } from '@angular/core';
@Component({
templateUrl: 'main.html'
})
export class E2EPage { }

View File

@ -1,17 +1,14 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { Page1 } from './page1';
import { PageOne } from './page-one';
@NgModule({
declarations: [
Page1,
PageOne,
],
imports: [
DeepLinkModule.forChild(Page1)
],
entryComponents: [
Page1,
DeepLinkModule.forChild(PageOne),
]
})
export class Page1Module {}
export class PageOneModule {}

View File

@ -0,0 +1,8 @@
import { Component } from '@angular/core';
import { DeepLink } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page-one.html'
})
export class PageOne { }

View File

@ -1,6 +1,6 @@
import { Component, ViewEncapsulation } from '@angular/core';
import { App } from '../../../../..';
import { E2EPage } from '../pages/e2e-page/e2e-page';
import { PageOne } from '../pages/page-one/page-one';
@Component({
template: `
@ -8,8 +8,8 @@ import { E2EPage } from '../pages/e2e-page/e2e-page';
`,
encapsulation: ViewEncapsulation.None
})
export class E2EApp {
root = E2EPage;
export class AppComponent {
root = PageOne;
constructor(app: App) {
app.viewDidLeave.subscribe((ev: any) => {

View File

@ -2,29 +2,19 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../..';
import { E2EApp } from './app.component';
import { E2EPage } from '../pages/e2e-page/e2e-page';
import { AppComponent } from './app.component';
import { PageOneModule } from '../pages/page-one/page-one.module';
@NgModule({
declarations: [
E2EApp,
E2EPage,
AppComponent
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {}, {
links: [
{ component: E2EPage, name: 'e2e-page' },
{ loadChildren: '../pages/page2/page2.module#Page2Module', name: 'page2' },
{ loadChildren: '../pages/page3/page3.module#Page3Module', name: 'page3' }
]
})
IonicModule.forRoot(AppComponent, {}),
PageOneModule
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp,
E2EPage,
]
})
export class AppModule { }

View File

@ -1,16 +1,13 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { Page3 } from './page3';
import { PageOne } from './page-one';
@NgModule({
imports: [
DeepLinkModule.forChild(Page3)
DeepLinkModule.forChild(PageOne)
],
declarations: [
Page3
PageOne
],
entryComponents: [
Page3,
]
})
export class Page3Module { }
export class PageOneModule { }

View File

@ -1,7 +1,9 @@
import { Component } from '@angular/core';
import { LoadingController, NavController } from '../../../../../..';
import { DeepLink, LoadingController, NavController } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'main.html',
templateUrl: 'page-one.html',
styles: [
`
/* Fix the spinner used in e2e */
@ -77,7 +79,7 @@ import { LoadingController, NavController } from '../../../../../..';
}`
]
})
export class E2EPage {
export class PageOne {
constructor(
public loadingCtrl: LoadingController,
public navCtrl: NavController
@ -179,7 +181,7 @@ export class E2EPage {
loading.present();
setTimeout(() => {
this.navCtrl.push('page2');
this.navCtrl.push('PageTwo');
}, 1000);
setTimeout(() => {
@ -188,7 +190,7 @@ export class E2EPage {
}
goToPage2() {
this.navCtrl.push('page2');
this.navCtrl.push('PageTwo');
}
presentLoadingMultiple() {
@ -239,7 +241,7 @@ export class E2EPage {
dismissOnPageChange: true
}).present();
this.navCtrl.push('page2');
this.navCtrl.push('PageTwo');
}, 500);
}
@ -252,7 +254,7 @@ export class E2EPage {
}).present();
setTimeout(() => {
this.navCtrl.push('page2');
this.navCtrl.push('PageTwo');
}, 500);
}

View File

@ -0,0 +1,6 @@
<ion-header>
<ion-navbar>
<ion-title>Page 3</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>Some content</ion-content>

View File

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { PageThree } from './page-three';
@NgModule({
imports: [
DeepLinkModule.forChild(PageThree)
],
declarations: [
PageThree
]
})
export class PageThreeModule { }

View File

@ -0,0 +1,9 @@
import { Component } from '@angular/core';
import { DeepLink } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page-three.html'
})
export class PageThree {}

View File

@ -0,0 +1,16 @@
<ion-header>
<ion-navbar>
<ion-title>Page 2</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>Some content</ion-content>
<ion-footer>
<ion-toolbar>
<ion-buttons end>
<button ion-button icon-right (click)="goToPage3()">
Navigate
<ion-icon name="arrow-forward"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar>
</ion-footer>

View File

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { PageTwo } from './page-two';
@NgModule({
imports: [
DeepLinkModule.forChild(PageTwo)
],
declarations: [
PageTwo
],
})
export class PageTwoModule { }

View File

@ -0,0 +1,14 @@
import { Component } from '@angular/core';
import { DeepLink, NavController } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page-two.html'
})
export class PageTwo {
constructor(public navCtrl: NavController) {}
goToPage3() {
this.navCtrl.push('PageThree');
}
}

View File

@ -1,9 +0,0 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { Page2 } from './page2';
@NgModule({
imports: [DeepLinkModule.forChild(Page2)],
declarations: [Page2],
entryComponents: [Page2]
})
export class Page2Module { }

View File

@ -1,29 +0,0 @@
import { Component } from '@angular/core';
import { NavController } from '../../../../../..';
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>Page 2</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>Some content</ion-content>
<ion-footer>
<ion-toolbar>
<ion-buttons end>
<button ion-button icon-right (click)="goToPage3()">
Navigate
<ion-icon name="arrow-forward"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar>
</ion-footer>
`
})
export class Page2 {
constructor(public navCtrl: NavController) {}
goToPage3() {
this.navCtrl.push('page3');
}
}

View File

@ -1,12 +0,0 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>Page 3</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>Some content</ion-content>
`
})
export class Page3 {}

View File

@ -1,8 +1,10 @@
import { Component } from '@angular/core';
import { TabsPage } from '../pages/tabs-page/tabs-page';
@Component({
template: '<ion-nav [root]="root"></ion-nav>'
})
export class E2EApp {
root = 'TabsPage';
export class AppComponent {
root = TabsPage;
}

View File

@ -1,26 +1,19 @@
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 { TabsPageModule } from '../pages/tabs-page/tabs-page.module';
@NgModule({
declarations: [
E2EApp
AppComponent
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {}, {
links: [
{ loadChildren: '../pages/main/main.module#E2EPageModule', name: 'E2EPage' },
{ loadChildren: '../pages/page2/page2.module#Page2Module', name: 'Page2' },
{ loadChildren: '../pages/tabs/tabs.module#TabsPageModule', name: 'TabsPage' }
]
})
IonicModule.forRoot(AppComponent, {}),
TabsPageModule
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp
]
})
export class AppModule {}

View File

@ -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 {}

View File

@ -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 {}

View File

@ -1,10 +1,11 @@
import { Component } from '@angular/core';
import { LoadingController, NavController } from '../../../../../..';
import { DeepLink, LoadingController, NavController } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'main.html'
templateUrl: 'page-one.html'
})
export class E2EPage {
export class PageOne {
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoading() {
@ -25,7 +26,7 @@ export class E2EPage {
loading.present();
setTimeout(() => {
this.navCtrl.push('Page2');
this.navCtrl.push('PageTwo');
setTimeout(() => {
loading.dismiss();

View File

@ -0,0 +1,6 @@
<ion-header>
<ion-navbar>
<ion-title>Page 2</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>Some content</ion-content>

View File

@ -1,17 +1,14 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { Modal } from './modal';
import { PageTwo } from './page-two';
@NgModule({
declarations: [
Modal,
PageTwo,
],
imports: [
DeepLinkModule.forChild(Modal)
DeepLinkModule.forChild(PageTwo)
],
entryComponents: [
Modal,
]
})
export class ModalModule {}
export class PageTwoModule {}

View File

@ -0,0 +1,8 @@
import { Component } from '@angular/core';
import { DeepLink } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page-two.html'
})
export class PageTwo {}

View File

@ -1,13 +0,0 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>Page 2</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>Some content</ion-content>
`
})
export class Page2 {}

View File

@ -0,0 +1,5 @@
<ion-tabs>
<ion-tab tabTitle="Plain List" tabIcon="star" [root]="root1"></ion-tab>
<ion-tab tabTitle="Schedule" tabIcon="globe" [root]="root2"></ion-tab>
<ion-tab tabTitle="Stopwatch" tabIcon="stopwatch" [root]="root3"></ion-tab>
</ion-tabs>

View File

@ -1,14 +1,16 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { TabsPage } from './tabs';
import { TabsPage } from './tabs-page';
import { PageOneModule } from '../page-one/page-one.module';
@NgModule({
declarations: [
TabsPage,
],
imports: [
DeepLinkModule.forChild(TabsPage)
DeepLinkModule.forChild(TabsPage),
PageOneModule
],
entryComponents: [
TabsPage,

View File

@ -0,0 +1,14 @@
import { Component } from '@angular/core';
import { DeepLink } from '../../../../../..';
import { PageOne} from '../page-one/page-one';
@DeepLink()
@Component({
templateUrl: 'tabs-page.html'
})
export class TabsPage {
root1 = PageOne;
root2 = 'PageTwo';
root3 = PageOne;
}

View File

@ -1,16 +0,0 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-tabs>
<ion-tab tabTitle="Plain List" tabIcon="star" [root]="root1"></ion-tab>
<ion-tab tabTitle="Schedule" tabIcon="globe" [root]="root2"></ion-tab>
<ion-tab tabTitle="Stopwatch" tabIcon="stopwatch" [root]="root3"></ion-tab>
</ion-tabs>
`
})
export class TabsPage {
root1 = 'E2EPage';
root2 = 'Page2';
root3 = 'E2EPage';
}

View File

@ -1,8 +1,9 @@
import { Component } from '@angular/core';
import { PageOne } from '../pages/page-one/page-one';
@Component({
template: '<ion-nav [root]="rootPage"></ion-nav>'
})
export class E2EApp {
rootPage = 'E2EPage';
export class AppComponent {
rootPage = PageOne;
}

View File

@ -2,27 +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' },
{ loadChildren: '../pages/page1/page1.module#Page1Module', name: 'Page1' },
{ loadChildren: '../pages/page2/page2.module#Page2Module', name: 'Page2' },
{ loadChildren: '../pages/page3/page3.module#Page3Module', name: 'Page3' },
{ loadChildren: '../components/modal/modal.module#ModalModule', name: 'Modal' },
]
})
IonicModule.forRoot(AppComponent, {}),
PageOneModule
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp,
]
bootstrap: [IonicApp]
})
export class AppModule { }

View File

@ -1,10 +0,0 @@
import { Component } from '@angular/core';
import { ViewController } from '../../../../../..';
@Component({ templateUrl: 'modal.html' })
export class Modal {
constructor(public viewController: ViewController) { }
close() {
this.viewController.dismiss();
}
}

View File

@ -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 {}

View File

@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { ModalPage } from './modal';
import { ModalPage } from './modal-page';
@NgModule({
declarations: [
@ -9,9 +9,6 @@ import { ModalPage } from './modal';
],
imports: [
DeepLinkModule.forChild(ModalPage)
],
entryComponents: [
ModalPage,
]
})
export class ModalPageModule {}

View File

@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { DeepLink, ViewController } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'modal-page.html'
})
export class ModalPage {
constructor(public viewController: ViewController) {
}
close() {
this.viewController.dismiss();
}
}

View File

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { PageFour } from './page-four';
@NgModule({
declarations: [
PageFour,
],
imports: [
DeepLinkModule.forChild(PageFour)
]
})
export class PageFourModule {}

View File

@ -0,0 +1,8 @@
import { Component } from '@angular/core';
import { DeepLink } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page-four.html'
})
export class PageFour { }

View File

@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { PageOne } from './page-one';
import { PageTwoModule } from '../page-two/page-two.module';
@NgModule({
declarations: [
PageOne,
],
imports: [
DeepLinkModule.forChild(PageOne),
PageTwoModule
]
})
export class PageOneModule {}

View File

@ -1,23 +1,25 @@
import { Component, ViewChild } from '@angular/core';
import { MenuController, Nav } from '../../../../../..';
import { DeepLink, MenuController, Nav } from '../../../../../..';
import { PageTwo } from '../page-two/page-two';
@DeepLink()
@Component({
templateUrl: 'main.html'
templateUrl: 'page-one.html'
})
export class E2EPage {
export class PageOne {
rootPage: any;
changeDetectionCount: number = 0;
pages: Array<{ title: string, component: any }>;
@ViewChild(Nav) nav: Nav;
constructor(public menuCtrl: MenuController) {
this.rootPage = 'Page1';
this.rootPage = PageTwo;
this.pages = [
{ title: 'Page 1', component: 'Page1' },
{ title: 'Page 2', component: 'Page2' },
{ title: 'Page 3', component: 'Page3' },
{ title: 'Page 1', component: PageTwo },
{ title: 'Page 2', component: 'PageThree' },
{ title: 'Page 3', component: 'PageFour' },
];
}

View File

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { PageThree } from './page-three';
@NgModule({
declarations: [
PageThree,
],
imports: [
DeepLinkModule.forChild(PageThree)
]
})
export class PageThreeModule {}

View File

@ -0,0 +1,14 @@
import { Component } from '@angular/core';
import { DeepLink, NavController } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page-three.html'
})
export class PageThree {
constructor(public navCtrl: NavController) { }
page3() {
this.navCtrl.push('PageFour');
}
}

View File

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { PageTwo } from './page-two';
@NgModule({
declarations: [
PageTwo,
],
imports: [
DeepLinkModule.forChild(PageTwo)
]
})
export class PageTwoModule {}

View File

@ -1,10 +1,11 @@
import { Component } from '@angular/core';
import { AlertController, ModalController, NavController } from '../../../../../..';
import { AlertController, DeepLink, ModalController, NavController } from '../../../../../..';
@DeepLink()
@Component({
templateUrl: 'page1.html'
templateUrl: 'page-two.html'
})
export class Page1 {
export class PageTwo {
constructor(
public navCtrl: NavController,
public alertCtrl: AlertController,
@ -23,11 +24,11 @@ export class Page1 {
}
presentModal() {
let modal = this.modalCtrl.create('Modal');
let modal = this.modalCtrl.create('ModalPage');
modal.present();
}
goToPage2() {
this.navCtrl.push('Page2');
this.navCtrl.push('PageThree');
}
}

View File

@ -1,11 +0,0 @@
import { Component } from '@angular/core';
import { NavController } from '../../../../../..';
@Component({ templateUrl: 'page2.html' })
export class Page2 {
constructor(public navCtrl: NavController) { }
page3() {
this.navCtrl.push('Page3');
}
}

View File

@ -1,17 +0,0 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { Page3 } from './page3';
@NgModule({
declarations: [
Page3,
],
imports: [
DeepLinkModule.forChild(Page3)
],
entryComponents: [
Page3,
]
})
export class Page3Module {}

View File

@ -1,4 +0,0 @@
import { Component } from '@angular/core';
@Component({ templateUrl: 'page3.html' })
export class Page3 { }

View File

@ -1,8 +1,10 @@
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;
}

View File

@ -2,35 +2,25 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicModule, IonicApp } from '../../../../..';
import { E2EApp } from './app.component';
import { AppComponent } from './app.component';
import { PageOneModule } from '../pages/page-one/page-one.module';
import { SomeAppProvider } from '../services/some-app-provider';
@NgModule({
declarations: [
E2EApp,
AppComponent,
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {
IonicModule.forRoot(AppComponent, {
statusbarPadding: true,
swipeBackEnabled: true
}, {
links: [
{ loadChildren: '../pages/main/main.module#E2EPageModule', name: 'E2EPage' },
{ loadChildren: '../pages/modal-first/modal-first.module#ModalFirstPageModule', name: 'ModalFirstPage' },
{ loadChildren: '../pages/modal-second/modal-second.module#ModalSecondPageModule', name: 'ModalSecondPage' },
{ loadChildren: '../components/contact-us/contact-us.module#ContactUsModalModule', name: 'ContactUsModal' },
{ loadChildren: '../components/modal-pass-data/modal-pass-data.module#ModalPassDataModule', name: 'ModalPassData' },
{ loadChildren: '../components/modal-with-inputs/modal-with-inputs.module#ModalWithInputsModule', name: 'ModalWithInputs' },
{ loadChildren: '../components/toolbar/toolbar.module#ToolbarModalModule', name: 'ToolbarModal' },
]
})
}),
PageOneModule
],
bootstrap: [IonicApp],
providers: [SomeAppProvider],
entryComponents: [
E2EApp,
]
})
export class AppModule {}

View File

@ -1,17 +0,0 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { ContactUsModal } from './contact-us';
@NgModule({
declarations: [
ContactUsModal,
],
imports: [
DeepLinkModule.forChild(ContactUsModal)
],
entryComponents: [
ContactUsModal,
]
})
export class ContactUsModalModule {}

View File

@ -1,56 +0,0 @@
import { Component } from '@angular/core';
import { ViewController } from '../../../../../..';
@Component({
template: `
<ion-header>
<ion-toolbar color="secondary">
<ion-buttons start>
<button ion-button (click)="dismiss()" strong>Close</button>
</ion-buttons>
<ion-title>Modal w/ Inputs</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<form #addForm="ngForm" (submit)="save($event)" novalidate>
<ion-list>
<ion-item>
<ion-label floating>Title <span [hidden]="data.title.valid">(Required)</span></ion-label>
<ion-input [(ngModel)]="data.title" name="title" #title="ngModel" type="text" required autofocus></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Note <span [hidden]="data.note.valid">(Required)</span></ion-label>
<ion-input [(ngModel)]="data.note" name="note" #note="ngModel" type="text" required></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Icon</ion-label>
<ion-input [(ngModel)]="data.icon" name="icon" #icon="ngModel" type="text" autocomplete="on" autocorrect="on"></ion-input>
</ion-item>
</ion-list>
<div padding>
<button ion-button block large type="submit" [disabled]="!addForm.valid">Save</button>
</div>
</form>
</ion-content>
`
})
export class ModalWithInputs {
data: any;
constructor(public viewCtrl: ViewController) {
this.data = {
title: 'Title',
note: 'Note',
icon: 'home'
};
}
public save(ev: any) {
this.viewCtrl.dismiss(this.data);
}
public dismiss() {
this.viewCtrl.dismiss(null);
}
}

View File

@ -1,58 +0,0 @@
import { Component } from '@angular/core';
import { ViewController, AlertController } from '../../../../../..';
@Component({
template: `
<ion-header>
<ion-toolbar color="primary">
<ion-title>Toolbar 1</ion-title>
</ion-toolbar>
<ion-toolbar>
<ion-title>Toolbar 2</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<button ion-button block color="danger" (click)="dismiss()" class="e2eCloseToolbarModal">
Dismission Modal
</button>
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vel ipsum in purus mollis dictum eget vitae purus. Nulla ultrices est odio, a maximus velit pretium ac. Donec vel elementum mi. Proin elementum pulvinar neque, in lacinia nibh tempus auctor. Nam sapien velit, commodo ac nibh a, maximus ullamcorper nunc. Integer luctus tortor dignissim, dictum neque at, scelerisque purus. Vivamus nec erat vel magna posuere euismod. Sed ac augue eu tellus tincidunt fermentum eget sit amet nunc. Donec sit amet mi libero. Cras nunc arcu, ultrices nec sapien eu, convallis posuere libero. Pellentesque vulputate lacus eros, at lobortis lorem egestas et. Vestibulum tempus quam in efficitur lobortis. Maecenas consectetur consequat sem pharetra aliquet. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</div>
<div>Mauris ac ligula elit. Nulla pulvinar eget leo ut aliquet. Praesent sit amet luctus quam. Nam fringilla iaculis mi, ut maximus mauris molestie feugiat. Curabitur nec scelerisque elit. Nunc eu odio facilisis, tempor enim eget, venenatis sem. Sed vitae lorem vehicula, auctor orci ultrices, finibus mauris. Donec vitae pulvinar diam. Nulla luctus congue quam, sed lacinia arcu dictum a.</div>
<div>Morbi laoreet magna elit, id dapibus massa varius consequat. Praesent rhoncus nunc quam, eu mollis velit commodo ut. Etiam euismod elit mi, non auctor velit blandit ut. Aenean vitae pulvinar mi, ac pretium tellus. Morbi eu auctor sem, sollicitudin cursus felis. Praesent vestibulum velit sed eros iaculis ornare. Praesent diam diam, pellentesque eget scelerisque sed, bibendum ut risus. Sed sed fermentum sem. Integer vel justo felis. Proin eget quam est. In sit amet ipsum sagittis, convallis ipsum fringilla, interdum ante. Etiam vel tincidunt mauris. Nunc feugiat eros nunc, et vestibulum metus mollis et. Nullam eu viverra velit, id ultrices nisl. Donec non enim elementum, laoreet sapien id, feugiat tellus.</div>
<div>Sed pellentesque ipsum eget ante hendrerit maximus. Aliquam id venenatis nulla. Nullam in nibh at enim vestibulum ullamcorper. Nam felis dolor, lobortis vel est non, condimentum malesuada nisl. In metus sapien, malesuada at nulla in, pretium aliquam turpis. Quisque elementum purus mi, sed tristique turpis ultricies in. Donec feugiat dolor non ultricies ultricies. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin ut purus et diam porta cursus vitae semper mi. Donec fringilla tellus orci. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nunc vitae commodo sem. Duis vehicula quam sit amet imperdiet facilisis. Pellentesque eget dignissim neque, et scelerisque libero. Maecenas molestie metus sed orci cursus, in venenatis justo dapibus.</div>
<div>Aenean rhoncus urna at interdum blandit. Donec ac massa nec libero vehicula tincidunt. Sed sit amet hendrerit risus. Aliquam vitae vestibulum ipsum, non feugiat orci. Vivamus eu rutrum elit. Nulla dapibus tortor non dignissim pretium. Nulla in luctus turpis. Etiam non mattis tortor, at aliquet ex. Nunc ut ante varius, auctor dui vel, volutpat elit. Nunc laoreet augue sit amet ultrices porta. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vestibulum pellentesque lobortis est, ut tincidunt ligula mollis sit amet. In porta risus arcu, quis pellentesque dolor mattis non. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;</div>
<button ion-button block color="danger" (click)="dismiss()">
Dismission Modal
</button>
</ion-content>
`
})
export class ToolbarModal {
constructor(public viewCtrl: ViewController, public alertCtrl: AlertController) {}
ionViewDidEnter() {
let alert = this.alertCtrl.create({
title: 'Test',
buttons: [
{
text: 'Something',
role: 'cancel'
}
]
});
alert.present();
}
dismiss() {
this.viewCtrl.dismiss();
}
}

View File

@ -0,0 +1 @@
<ion-nav [root]="root"></ion-nav>

View File

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { ContactUs } from './contact-us';
@NgModule({
declarations: [
ContactUs,
],
imports: [
DeepLinkModule.forChild(ContactUs)
]
})
export class ContactUsModule {}

View File

@ -1,10 +1,12 @@
import { Component } from '@angular/core';
import { DeepLink } from '../../../../../..';
@DeepLink()
@Component({
template: '<ion-nav [root]="root"></ion-nav>'
templateUrl: 'contact-us.html'
})
export class ContactUsModal {
root = 'ModalFirstPage';
export class ContactUs {
root = 'PageTwo';
constructor() {
console.log('ContactUs constructor');

View File

@ -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 {}

Some files were not shown because too many files have changed in this diff Show More