import { Component , NgModule , ViewChild } from '@angular/core' ; import { BrowserModule } from '@angular/platform-browser' ; import { IonicApp , IonicModule , Slides } from '../../../..' ; @ Component ( { templateUrl : 'main.html' } ) export class E2EPage { slides : any [ ] ; @ ViewChild ( 'loopSlider' ) loopSlider : Slides ; startingIndex : number ; myTopSlideOptions : any ; constructor ( ) { this . slides = [ { name : 'Slide 1' , class : 'yellow' } , { name : 'Slide 2' , class : 'red' } , { name : 'Slide 3' , class : 'blue' } ] ; this . myTopSlideOptions = { initialSlide : 2 , loop : true } ; } onSlideChanged ( slider ) { console . log ( 'Slide changed' , slider ) ; } ngAfterViewInit ( ) { console . log ( this . loopSlider ) ; } } @ 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 ] } ) export class AppModule { }