mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(slides): fix slides test to use app and pages
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
import { Component, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../..';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class E2EPage {
|
||||
|
||||
onSlideWillChange(s: any) {
|
||||
console.log(`onSlideWillChange: ${s}`);
|
||||
}
|
||||
|
||||
onSlideDidChange(s: any) {
|
||||
console.log(`onSlideDidChange: ${s}`);
|
||||
}
|
||||
|
||||
onSlideDrag(s: any) {
|
||||
console.log(`onSlideDrag: ${s}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = E2EPage;
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
E2EPage
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
AppComponent,
|
||||
E2EPage
|
||||
],
|
||||
schemas: [
|
||||
CUSTOM_ELEMENTS_SCHEMA
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
9
src/components/slides/test/basic/app/app.component.ts
Normal file
9
src/components/slides/test/basic/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { RootPage } from '../pages/root-page/root-page';
|
||||
|
||||
@Component({
|
||||
template: `<ion-nav [root]="root"></ion-nav>`
|
||||
})
|
||||
export class AppComponent {
|
||||
root = RootPage;
|
||||
}
|
||||
20
src/components/slides/test/basic/app/app.module.ts
Normal file
20
src/components/slides/test/basic/app/app.module.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../..';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { RootPageModule } from '../pages/root-page/root-page.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent, {}),
|
||||
RootPageModule
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
export class AppModule { }
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<ion-slides style="background: black"
|
||||
(ionSlideWillChange)="onSlideWillChange($event)"
|
||||
(ionSlideDidChange)="onSlideDidChange($event)"
|
||||
@@ -0,0 +1,15 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
|
||||
import { RootPage } from './root-page';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
RootPage,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(RootPage)
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
export class RootPageModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'root-page.html'
|
||||
})
|
||||
export class RootPage {
|
||||
|
||||
onSlideWillChange(s: any) {
|
||||
console.log(`onSlideWillChange: ${s}`);
|
||||
}
|
||||
|
||||
onSlideDidChange(s: any) {
|
||||
console.log(`onSlideDidChange: ${s}`);
|
||||
}
|
||||
|
||||
onSlideDrag(s: any) {
|
||||
console.log(`onSlideDrag: ${s}`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -155,7 +155,7 @@ import { AppModule as SelectSingleValue } from '../../../../../select/test/singl
|
||||
|
||||
import { AppModule as ShowHideWhenBasic } from '../../../../../show-hide-when/test/basic/app.module';
|
||||
|
||||
import { AppModule as SlidesBasic } from '../../../../../slides/test/basic/app.module';
|
||||
import { AppModule as SlidesBasic } from '../../../../../slides/test/basic/app/app.module';
|
||||
import { AppModule as SlidesControl } from '../../../../../slides/test/control/app.module';
|
||||
import { AppModule as SlidesController } from '../../../../../slides/test/controller/app.module';
|
||||
import { AppModule as SlidesImages } from '../../../../../slides/test/images/app.module';
|
||||
|
||||
@@ -156,7 +156,7 @@ import { AppComponent as SelectSingleValue } from '../../../../../select/test/si
|
||||
|
||||
import { AppComponent as ShowHideWhenBasic } from '../../../../../show-hide-when/test/basic/app.module';
|
||||
|
||||
import { AppComponent as SlidesBasic } from '../../../../../slides/test/basic/app.module';
|
||||
import { AppComponent as SlidesBasic } from '../../../../../slides/test/basic/app/app.component';
|
||||
import { AppComponent as SlidesControl } from '../../../../../slides/test/control/app.module';
|
||||
import { AppComponent as SlidesController } from '../../../../../slides/test/controller/app.module';
|
||||
import { AppComponent as SlidesImages } from '../../../../../slides/test/images/app.module';
|
||||
|
||||
Reference in New Issue
Block a user