From 381a650f8ee4cd6f0b3dd512d818f7cc9159b96d Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Tue, 19 Apr 2016 17:34:51 -0400 Subject: [PATCH] test(slides): update slides tests with new API and add new one references #5508 --- .../slides/test/controller/index.ts | 52 +++++++++++++++++++ .../slides/test/controller/main.html | 16 ++++++ ionic/components/slides/test/intro/main.html | 2 +- ionic/components/slides/test/loop/index.ts | 5 +- ionic/components/slides/test/loop/main.html | 4 +- 5 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 ionic/components/slides/test/controller/index.ts create mode 100644 ionic/components/slides/test/controller/main.html diff --git a/ionic/components/slides/test/controller/index.ts b/ionic/components/slides/test/controller/index.ts new file mode 100644 index 0000000000..42ddeed8ca --- /dev/null +++ b/ionic/components/slides/test/controller/index.ts @@ -0,0 +1,52 @@ +import {ViewChild} from 'angular2/core'; +import {App, Slides} from 'ionic-angular'; + + +@App({ + templateUrl: 'main.html' +}) +class MyApp { + mySlideOptions: any; + @ViewChild(Slides) slider: Slides; + + constructor() { + console.log("here"); + this.mySlideOptions = { + initialSlide: 1, + autoplay: 1000 + }; + } + + ngAfterViewInit() { + + } + + onSlideChanged() { + console.log("Slide Changed"); + let isEnd = this.slider.isEnd(); + console.log("This is the last slide?", isEnd); + } + + goToPrevSlide() { + this.slider.slidePrev(5000, false); + } + + goToNextSlide() { + this.slider.slideNext(); + } + + goToSlide(index) { + console.log(index); + this.slider.slideTo(index, 500, false); + } + + getIndex() { + let index = this.slider.getActiveIndex(); + console.log("Current Index is", index); + } + + getLength() { + let length = this.slider.length(); + console.log("Current Length is", length); + } +} diff --git a/ionic/components/slides/test/controller/main.html b/ionic/components/slides/test/controller/main.html new file mode 100644 index 0000000000..5ba590e94b --- /dev/null +++ b/ionic/components/slides/test/controller/main.html @@ -0,0 +1,16 @@ + + +

Slide 1

+ + +
+ +

Slide 2

+ + +
+ +

Slide 3

+ +
+
diff --git a/ionic/components/slides/test/intro/main.html b/ionic/components/slides/test/intro/main.html index 33cb3a55e9..f2a1e4d888 100644 --- a/ionic/components/slides/test/intro/main.html +++ b/ionic/components/slides/test/intro/main.html @@ -8,7 +8,7 @@ - +

Thank you for choosing the Awesome App!