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