mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 21:15:24 +08:00
test(list, loading): update test for lazyloading
This commit is contained in:
@ -1,33 +0,0 @@
|
|||||||
import { Component, NgModule } from '@angular/core';
|
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { IonicApp, IonicModule } from '../../../..';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
templateUrl: 'main.html'
|
|
||||||
})
|
|
||||||
export class E2EPage {}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
template: '<ion-nav [root]="rootPage"></ion-nav>'
|
|
||||||
})
|
|
||||||
export class E2EApp {
|
|
||||||
rootPage = E2EPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
declarations: [
|
|
||||||
E2EApp,
|
|
||||||
E2EPage
|
|
||||||
],
|
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
IonicModule.forRoot(E2EApp)
|
|
||||||
],
|
|
||||||
bootstrap: [IonicApp],
|
|
||||||
entryComponents: [
|
|
||||||
E2EApp,
|
|
||||||
E2EPage
|
|
||||||
]
|
|
||||||
})
|
|
||||||
export class AppModule {}
|
|
9
src/components/list/test/headers/app/app.component.ts
Normal file
9
src/components/list/test/headers/app/app.component.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { E2EPage } from '../pages/e2e-page/e2e-page';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
template: '<ion-nav [root]="rootPage"></ion-nav>'
|
||||||
|
})
|
||||||
|
export class E2EApp {
|
||||||
|
rootPage = E2EPage;
|
||||||
|
}
|
27
src/components/list/test/headers/app/app.module.ts
Normal file
27
src/components/list/test/headers/app/app.module.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
IonicModule.forRoot(E2EApp, {}, {
|
||||||
|
links: [
|
||||||
|
{ component: E2EPage, name: 'e2e-page' }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
],
|
||||||
|
bootstrap: [IonicApp],
|
||||||
|
entryComponents: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
@ -0,0 +1,5 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
@Component({
|
||||||
|
templateUrl: 'main.html'
|
||||||
|
})
|
||||||
|
export class E2EPage { }
|
@ -1,33 +0,0 @@
|
|||||||
import { Component, NgModule } from '@angular/core';
|
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { IonicApp, IonicModule } from '../../../..';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
templateUrl: 'main.html'
|
|
||||||
})
|
|
||||||
export class E2EPage {}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
template: '<ion-nav [root]="rootPage"></ion-nav>'
|
|
||||||
})
|
|
||||||
export class E2EApp {
|
|
||||||
rootPage = E2EPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
declarations: [
|
|
||||||
E2EApp,
|
|
||||||
E2EPage
|
|
||||||
],
|
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
IonicModule.forRoot(E2EApp)
|
|
||||||
],
|
|
||||||
bootstrap: [IonicApp],
|
|
||||||
entryComponents: [
|
|
||||||
E2EApp,
|
|
||||||
E2EPage
|
|
||||||
]
|
|
||||||
})
|
|
||||||
export class AppModule {}
|
|
8
src/components/list/test/inset/app/app.component.ts
Normal file
8
src/components/list/test/inset/app/app.component.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { E2EPage } from '../pages/e2e-page/e2e-page';
|
||||||
|
@Component({
|
||||||
|
template: '<ion-nav [root]="rootPage"></ion-nav>'
|
||||||
|
})
|
||||||
|
export class E2EApp {
|
||||||
|
rootPage = E2EPage;
|
||||||
|
}
|
27
src/components/list/test/inset/app/app.module.ts
Normal file
27
src/components/list/test/inset/app/app.module.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
IonicModule.forRoot(E2EApp, {}, {
|
||||||
|
links: [
|
||||||
|
{ component: E2EPage, name: 'e2e-page' }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
],
|
||||||
|
bootstrap: [IonicApp],
|
||||||
|
entryComponents: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
@ -0,0 +1,5 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
@Component({
|
||||||
|
templateUrl: 'main.html'
|
||||||
|
})
|
||||||
|
export class E2EPage { }
|
@ -1,33 +0,0 @@
|
|||||||
import { Component, NgModule } from '@angular/core';
|
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { IonicApp, IonicModule } from '../../../..';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
templateUrl: 'main.html'
|
|
||||||
})
|
|
||||||
export class E2EPage {}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
template: '<ion-nav [root]="rootPage"></ion-nav>'
|
|
||||||
})
|
|
||||||
export class E2EApp {
|
|
||||||
rootPage = E2EPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
declarations: [
|
|
||||||
E2EApp,
|
|
||||||
E2EPage
|
|
||||||
],
|
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
IonicModule.forRoot(E2EApp)
|
|
||||||
],
|
|
||||||
bootstrap: [IonicApp],
|
|
||||||
entryComponents: [
|
|
||||||
E2EApp,
|
|
||||||
E2EPage
|
|
||||||
]
|
|
||||||
})
|
|
||||||
export class AppModule {}
|
|
10
src/components/list/test/no-lines/app/app.component.ts
Normal file
10
src/components/list/test/no-lines/app/app.component.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { E2EPage } from '../pages/e2e-page/e2e-page';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
template: '<ion-nav [root]="rootPage"></ion-nav>'
|
||||||
|
})
|
||||||
|
export class E2EApp {
|
||||||
|
rootPage = E2EPage;
|
||||||
|
}
|
||||||
|
|
27
src/components/list/test/no-lines/app/app.module.ts
Normal file
27
src/components/list/test/no-lines/app/app.module.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
IonicModule.forRoot(E2EApp, {}, {
|
||||||
|
links: [
|
||||||
|
{ component: E2EPage, name: 'e2e-page' }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
],
|
||||||
|
bootstrap: [IonicApp],
|
||||||
|
entryComponents: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
@ -0,0 +1,6 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: 'main.html'
|
||||||
|
})
|
||||||
|
export class E2EPage { }
|
23
src/components/loading/test/basic/app/app.component.ts
Normal file
23
src/components/loading/test/basic/app/app.component.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { Component, ViewEncapsulation } from '@angular/core';
|
||||||
|
import { App } from '../../../../..';
|
||||||
|
import { E2EPage } from '../pages/e2e-page/e2e-page';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
template: `
|
||||||
|
<ion-nav [root]="root"></ion-nav>
|
||||||
|
`,
|
||||||
|
encapsulation: ViewEncapsulation.None
|
||||||
|
})
|
||||||
|
export class E2EApp {
|
||||||
|
root = E2EPage;
|
||||||
|
|
||||||
|
constructor(app: App) {
|
||||||
|
app.viewDidLeave.subscribe((ev: any) => {
|
||||||
|
console.log('App didLeave');
|
||||||
|
});
|
||||||
|
|
||||||
|
app.viewWillLeave.subscribe((ev: any) => {
|
||||||
|
console.log('App willLeave');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
30
src/components/loading/test/basic/app/app.module.ts
Normal file
30
src/components/loading/test/basic/app/app.module.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage,
|
||||||
|
],
|
||||||
|
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' }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
],
|
||||||
|
bootstrap: [IonicApp],
|
||||||
|
entryComponents: [
|
||||||
|
E2EApp,
|
||||||
|
E2EPage,
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
||||||
|
|
@ -1,8 +1,5 @@
|
|||||||
import { Component, ViewEncapsulation, NgModule } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { LoadingController, NavController } from '../../../../../..';
|
||||||
import { App, IonicApp, IonicModule, LoadingController, NavController } from '../../../..';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: 'main.html',
|
templateUrl: 'main.html',
|
||||||
styles: [
|
styles: [
|
||||||
@ -81,7 +78,10 @@ import { App, IonicApp, IonicModule, LoadingController, NavController } from '..
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class E2EPage {
|
export class E2EPage {
|
||||||
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
|
constructor(
|
||||||
|
public loadingCtrl: LoadingController,
|
||||||
|
public navCtrl: NavController
|
||||||
|
) { }
|
||||||
|
|
||||||
presentLoadingIos() {
|
presentLoadingIos() {
|
||||||
let loading = this.loadingCtrl.create({
|
let loading = this.loadingCtrl.create({
|
||||||
@ -91,7 +91,7 @@ export class E2EPage {
|
|||||||
});
|
});
|
||||||
|
|
||||||
loading.onDidDismiss(() => {
|
loading.onDidDismiss(() => {
|
||||||
console.log('Dismissed loading');
|
console.log('Dismissed loading');
|
||||||
});
|
});
|
||||||
|
|
||||||
loading.present();
|
loading.present();
|
||||||
@ -179,7 +179,7 @@ export class E2EPage {
|
|||||||
loading.present();
|
loading.present();
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.navCtrl.push(Page2);
|
this.navCtrl.push('page2');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -188,7 +188,7 @@ export class E2EPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
goToPage2() {
|
goToPage2() {
|
||||||
this.navCtrl.push(Page2);
|
this.navCtrl.push('page2');
|
||||||
}
|
}
|
||||||
|
|
||||||
presentLoadingMultiple() {
|
presentLoadingMultiple() {
|
||||||
@ -214,12 +214,12 @@ export class E2EPage {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
loading3.present();
|
loading3.present();
|
||||||
|
|
||||||
loading3.dismiss();
|
loading3.dismiss();
|
||||||
loading2.dismiss();
|
loading2.dismiss();
|
||||||
loading.dismiss();
|
loading.dismiss();
|
||||||
|
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -239,7 +239,7 @@ export class E2EPage {
|
|||||||
dismissOnPageChange: true
|
dismissOnPageChange: true
|
||||||
}).present();
|
}).present();
|
||||||
|
|
||||||
this.navCtrl.push(Page2);
|
this.navCtrl.push('page2');
|
||||||
|
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
@ -252,88 +252,7 @@ export class E2EPage {
|
|||||||
}).present();
|
}).present();
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.navCtrl.push(Page2);
|
this.navCtrl.push('page2');
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@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 {}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
template: `
|
|
||||||
<ion-nav [root]="root"></ion-nav>
|
|
||||||
`,
|
|
||||||
encapsulation: ViewEncapsulation.None
|
|
||||||
})
|
|
||||||
export class E2EApp {
|
|
||||||
root = E2EPage;
|
|
||||||
|
|
||||||
constructor(app: App) {
|
|
||||||
app.viewDidLeave.subscribe((ev: any) => {
|
|
||||||
console.log('App didLeave');
|
|
||||||
});
|
|
||||||
|
|
||||||
app.viewWillLeave.subscribe((ev: any) => {
|
|
||||||
console.log('App willLeave');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
declarations: [
|
|
||||||
E2EApp,
|
|
||||||
E2EPage,
|
|
||||||
Page2,
|
|
||||||
Page3
|
|
||||||
],
|
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
IonicModule.forRoot(E2EApp)
|
|
||||||
],
|
|
||||||
bootstrap: [IonicApp],
|
|
||||||
entryComponents: [
|
|
||||||
E2EApp,
|
|
||||||
E2EPage,
|
|
||||||
Page2,
|
|
||||||
Page3
|
|
||||||
]
|
|
||||||
})
|
|
||||||
export class AppModule {}
|
|
@ -0,0 +1,9 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { DeepLinkModule } from '../../../../../..';
|
||||||
|
import { Page2 } from './page2';
|
||||||
|
@NgModule({
|
||||||
|
imports: [DeepLinkModule.forChild(Page2)],
|
||||||
|
declarations: [Page2],
|
||||||
|
entryComponents: [Page2]
|
||||||
|
})
|
||||||
|
export class Page2Module { }
|
29
src/components/loading/test/basic/pages/page2/page2.ts
Normal file
29
src/components/loading/test/basic/pages/page2/page2.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { DeepLinkModule } from '../../../../../..';
|
||||||
|
import { Page3 } from './page3';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
DeepLinkModule.forChild(Page3)
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
Page3
|
||||||
|
],
|
||||||
|
entryComponents: [
|
||||||
|
Page3,
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class Page3Module { }
|
12
src/components/loading/test/basic/pages/page3/page3.ts
Normal file
12
src/components/loading/test/basic/pages/page3/page3.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
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 {}
|
Reference in New Issue
Block a user