test(slides): fix slides test to use app and pages

This commit is contained in:
Brandy Carney
2017-06-14 15:00:23 -04:00
parent 041b45f8aa
commit d922485c90
9 changed files with 66 additions and 53 deletions

View File

@@ -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 {}

View 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;
}

View 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 { }

View File

@@ -1,4 +1,3 @@
<ion-slides style="background: black"
(ionSlideWillChange)="onSlideWillChange($event)"
(ionSlideDidChange)="onSlideDidChange($event)"

View File

@@ -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 {}

View File

@@ -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}`);
}
}

View File

@@ -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';

View File

@@ -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';