mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00
docs(e2e): lazy load modals in action-sheet/basic, alert/basic, app/cordova
This commit is contained in:
@ -12,7 +12,11 @@ import { PageOneModule } from '../pages/page-one/page-one.module';
|
|||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
IonicModule.forRoot(AppComponent),
|
IonicModule.forRoot(AppComponent, {}, {
|
||||||
|
links: [
|
||||||
|
{ loadChildren: '../pages/modal-page/modal-page.module#ModalPageModule', name: 'modal-page' }
|
||||||
|
]
|
||||||
|
}),
|
||||||
ModalPageModule,
|
ModalPageModule,
|
||||||
PageOneModule
|
PageOneModule
|
||||||
],
|
],
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { ActionSheetController, AlertController, ModalController, Platform } from '../../../../../..';
|
import { ActionSheetController, AlertController, ModalController, Platform } from '../../../../../..';
|
||||||
|
|
||||||
import { ModalPage } from '../modal-page/modal-page';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: 'page-one.html'
|
templateUrl: 'page-one.html'
|
||||||
})
|
})
|
||||||
@ -39,7 +37,7 @@ export class PageOne {
|
|||||||
icon: 'arrow-dropright-circle',
|
icon: 'arrow-dropright-circle',
|
||||||
handler: () => {
|
handler: () => {
|
||||||
this.result = 'Play (open modal)';
|
this.result = 'Play (open modal)';
|
||||||
let modal = this.modalCtrl.create(ModalPage);
|
let modal = this.modalCtrl.create('modal-page');
|
||||||
modal.present();
|
modal.present();
|
||||||
|
|
||||||
// returning false does not allow the actionsheet to be closed
|
// returning false does not allow the actionsheet to be closed
|
||||||
|
@ -12,8 +12,11 @@ import { PageOneModule } from '../pages/page-one/page-one.module';
|
|||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
IonicModule.forRoot(E2EApp),
|
IonicModule.forRoot(E2EApp, {}, {
|
||||||
ModalPageModule,
|
links: [
|
||||||
|
{ loadChildren: '../pages/modal-page/modal-page.module#ModalPageModule', name: 'modal-page'}
|
||||||
|
]
|
||||||
|
}),
|
||||||
PageOneModule
|
PageOneModule
|
||||||
],
|
],
|
||||||
bootstrap: [IonicApp]
|
bootstrap: [IonicApp]
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { AlertController, ModalController } from '../../../../../..';
|
import { AlertController, ModalController } from '../../../../../..';
|
||||||
|
|
||||||
import { ModalPage } from '../modal-page/modal-page';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: 'page-one.html'
|
templateUrl: 'page-one.html'
|
||||||
})
|
})
|
||||||
@ -83,7 +81,7 @@ export class PageOne {
|
|||||||
alert.addButton({
|
alert.addButton({
|
||||||
text: 'Open Modal',
|
text: 'Open Modal',
|
||||||
handler: () => {
|
handler: () => {
|
||||||
this.modalCtrl.create(ModalPage).present();
|
this.modalCtrl.create('modal-page').present();
|
||||||
|
|
||||||
// do not close the alert when this button is pressed
|
// do not close the alert when this button is pressed
|
||||||
return false;
|
return false;
|
||||||
|
@ -19,6 +19,7 @@ import { PageOneModule } from '../pages/page-one/page-one.module';
|
|||||||
{ name: 'page-three', loadChildren: '../pages/page-three/page-three.module#PageThreeModule'},
|
{ name: 'page-three', loadChildren: '../pages/page-three/page-three.module#PageThreeModule'},
|
||||||
{ name: 'tabs-page', loadChildren: '../pages/tabs/tabs-page.module#TabsPageModule'},
|
{ 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: 'tabs-page-one', loadChildren: '../pages/tabs-page-one/tabs-page-one.module#TabsPageOneModule'},
|
||||||
|
{ name: 'modal-page', loadChildren: '../pages/modal/modal.module#ModalPageModule'}
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
PageOneModule
|
PageOneModule
|
||||||
|
@ -2,15 +2,13 @@ import { NgModule } from '@angular/core';
|
|||||||
import { DeepLinkModule } from '../../../../../..';
|
import { DeepLinkModule } from '../../../../../..';
|
||||||
|
|
||||||
import { PageTwo } from './page-two';
|
import { PageTwo } from './page-two';
|
||||||
import { ModalPageModule } from '../modal/modal.module';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
PageTwo,
|
PageTwo,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
DeepLinkModule.forChild(PageTwo),
|
DeepLinkModule.forChild(PageTwo)
|
||||||
ModalPageModule
|
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
PageTwo,
|
PageTwo,
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { ModalController } from '../../../../../..';
|
import { ModalController } from '../../../../../..';
|
||||||
|
|
||||||
import { ModalPage } from '../modal/modal-page';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: 'page-two.html'
|
templateUrl: 'page-two.html'
|
||||||
})
|
})
|
||||||
@ -13,7 +11,7 @@ export class PageTwo {
|
|||||||
constructor(public modalCtrl: ModalController) {}
|
constructor(public modalCtrl: ModalController) {}
|
||||||
|
|
||||||
openModal() {
|
openModal() {
|
||||||
const modal = this.modalCtrl.create(ModalPage);
|
const modal = this.modalCtrl.create('modal-page');
|
||||||
modal.present();
|
modal.present();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user