mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
test(ngmodule): update to ngmodule
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { ionicBootstrap, LoadingController, NavController } from '../../../../../src';
|
||||
import { Component, ViewEncapsulation, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule, LoadingController, NavController } from '../../../..';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EPage {
|
||||
export class E2EPage {
|
||||
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
|
||||
|
||||
presentLoadingIos() {
|
||||
@ -88,7 +88,7 @@ class E2EPage {
|
||||
|
||||
loading.present();
|
||||
setTimeout(() => {
|
||||
loading.setContent("Loaded!");
|
||||
loading.setContent('Loaded!');
|
||||
}, 1000);
|
||||
setTimeout(() => {
|
||||
loading.dismiss();
|
||||
@ -141,53 +141,32 @@ class E2EPage {
|
||||
setTimeout(() => {
|
||||
loading3.present();
|
||||
|
||||
setTimeout(() => {
|
||||
loading3.dismiss();
|
||||
}, 1000);
|
||||
loading3.dismiss();
|
||||
loading2.dismiss();
|
||||
loading.dismiss();
|
||||
|
||||
setTimeout(() => {
|
||||
loading2.dismiss();
|
||||
}, 2000);
|
||||
|
||||
setTimeout(() => {
|
||||
loading.dismiss();
|
||||
}, 3000);
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
|
||||
presentLoadingMultipleNav() {
|
||||
let loading = this.loadingCtrl.create({
|
||||
this.loadingCtrl.create({
|
||||
spinner: 'hide',
|
||||
content: 'Loading 1 Please Wait...',
|
||||
dismissOnPageChange: true
|
||||
});
|
||||
|
||||
loading.present();
|
||||
|
||||
let loading2 = this.loadingCtrl.create({
|
||||
spinner: 'hide',
|
||||
content: 'Loading 2 Please Wait...',
|
||||
dismissOnPageChange: true
|
||||
});
|
||||
}).present();
|
||||
|
||||
setTimeout(() => {
|
||||
loading2.present();
|
||||
|
||||
this.loadingCtrl.create({
|
||||
spinner: 'hide',
|
||||
content: 'Loading 2 Please Wait...',
|
||||
dismissOnPageChange: true
|
||||
}).present();
|
||||
|
||||
this.navCtrl.push(Page2);
|
||||
|
||||
}, 500);
|
||||
|
||||
let loading3 = this.loadingCtrl.create({
|
||||
spinner: 'hide',
|
||||
content: 'Loading 3 Please Wait...',
|
||||
dismissOnPageChange: true
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
loading3.present();
|
||||
|
||||
setTimeout(() => {
|
||||
this.navCtrl.push(Page2);
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,10 +190,10 @@ class E2EPage {
|
||||
</ion-footer>
|
||||
`
|
||||
})
|
||||
class Page2 {
|
||||
export class Page2 {
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
ionViewLoaded() {
|
||||
ionViewDidLoad() {
|
||||
setTimeout(() => {
|
||||
this.navCtrl.push(Page3);
|
||||
}, 1000);
|
||||
@ -235,17 +214,34 @@ class Page2 {
|
||||
<ion-content padding>Some content</ion-content>
|
||||
`
|
||||
})
|
||||
class Page3 {}
|
||||
export class Page3 {}
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<link href="styles.css" rel="stylesheet">
|
||||
<ion-nav [root]="root"></ion-nav>
|
||||
`,
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
class E2EApp {
|
||||
export class E2EApp {
|
||||
root = E2EPage;
|
||||
}
|
||||
|
||||
ionicBootstrap(E2EApp);
|
||||
@NgModule({
|
||||
declarations: [
|
||||
E2EApp,
|
||||
E2EPage,
|
||||
Page2,
|
||||
Page3
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(E2EApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
E2EApp,
|
||||
E2EPage,
|
||||
Page2,
|
||||
Page3
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
@ -1,3 +1,5 @@
|
||||
<div class="e2e-loading">
|
||||
|
||||
<ion-header>
|
||||
|
||||
<ion-navbar>
|
||||
@ -35,3 +37,5 @@
|
||||
</ion-toolbar>
|
||||
|
||||
</ion-footer>
|
||||
|
||||
</div>
|
||||
|
@ -1,61 +0,0 @@
|
||||
/* Fix the spinner used in e2e */
|
||||
.fixed-spinner svg {
|
||||
animation: none;
|
||||
}
|
||||
|
||||
.custom-spinner-container {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.custom-spinner-box {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
border: 4px solid #000;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
animation: spin 3s infinite linear;
|
||||
}
|
||||
|
||||
.custom-spinner-box:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
box-sizing: border-box;
|
||||
border: 4px solid #000;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
animation: pulse 1.5s infinite ease;
|
||||
}
|
||||
|
||||
.wp .custom-spinner-box,
|
||||
.wp .custom-spinner-box:before {
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
@-webkit-keyframes pulse {
|
||||
50% {
|
||||
border-width: 20px;
|
||||
}
|
||||
}
|
||||
@keyframes pulse {
|
||||
50% {
|
||||
border-width: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes spin {
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes spin {
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { ionicBootstrap, LoadingController, NavController } from '../../../../../src';
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule, LoadingController, NavController } from '../../../..';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EPage {
|
||||
export class E2EPage {
|
||||
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
|
||||
|
||||
presentLoading() {
|
||||
@ -46,7 +46,7 @@ class E2EPage {
|
||||
<ion-content padding>Some content</ion-content>
|
||||
`
|
||||
})
|
||||
class Page2 {}
|
||||
export class Page2 {}
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
@ -58,16 +58,34 @@ class Page2 {}
|
||||
`
|
||||
})
|
||||
export class TabsPage {
|
||||
private root1 = E2EPage;
|
||||
private root2 = Page2;
|
||||
private root3 = E2EPage;
|
||||
root1 = E2EPage;
|
||||
root2 = Page2;
|
||||
root3 = E2EPage;
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
class E2EApp {
|
||||
export class E2EApp {
|
||||
root = TabsPage;
|
||||
}
|
||||
|
||||
ionicBootstrap(E2EApp);
|
||||
@NgModule({
|
||||
declarations: [
|
||||
E2EApp,
|
||||
E2EPage,
|
||||
TabsPage,
|
||||
Page2
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(E2EApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
E2EApp,
|
||||
E2EPage,
|
||||
TabsPage,
|
||||
Page2
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
Reference in New Issue
Block a user