Merge branch 'pr/5379' into 2.0

This commit is contained in:
Brandy Carney
2016-02-17 15:36:53 -05:00
3 changed files with 15 additions and 2 deletions

View File

@ -22,7 +22,7 @@ import {Scroll} from '../scroll/scroll';
* ```ts * ```ts
* @Page({ * @Page({
* template: ` * template: `
* <ion-slides pager (change)="onSlideChanged($event)" loop="true" autoplay="true"> * <ion-slides pager (change)="onSlideChanged($event)" (move)="onSlideMove($event)" loop="true" autoplay="true">
* <ion-slide> * <ion-slide>
* <h3>Thank you for choosing the Awesome App!</h3> * <h3>Thank you for choosing the Awesome App!</h3>
* <p> * <p>
@ -209,6 +209,11 @@ export class Slides extends Ion {
*/ */
@Output() slideChangeStart: EventEmitter<any> = new EventEmitter(); @Output() slideChangeStart: EventEmitter<any> = new EventEmitter();
/**
* @output {any} expression to evaluate when a slide moves
*/
@Output() move: EventEmitter<any> = new EventEmitter();
/** /**
* @private * @private
* @param {ElementRef} elementRef TODO * @param {ElementRef} elementRef TODO
@ -278,6 +283,10 @@ export class Slides extends Ion {
options.onLazyImageReady = (swiper, slide, img) => { options.onLazyImageReady = (swiper, slide, img) => {
return this.options.onLazyImageReady && this.options.onLazyImageReady(swiper, slide, img); return this.options.onLazyImageReady && this.options.onLazyImageReady(swiper, slide, img);
}; };
options.onSliderMove = (swiper, e) => {
this.move.emit(swiper);
return this.options.onSliderMove && this.options.onSliderMove(swiper, e);
};
setTimeout(() => { setTimeout(() => {
var swiper = new Swiper(this.getNativeElement().children[0], options); var swiper = new Swiper(this.getNativeElement().children[0], options);

View File

@ -29,6 +29,10 @@ class IntroPage {
slider.isEnd ? this.continueText = "Continue" : this.continueText = "Skip"; slider.isEnd ? this.continueText = "Continue" : this.continueText = "Skip";
} }
onSlideMove(slider) {
console.log("Slide move", slider);
}
skip() { skip() {
this.nav.push(MainPage); this.nav.push(MainPage);
} }

View File

@ -8,7 +8,7 @@
</ion-navbar> </ion-navbar>
<ion-content> <ion-content>
<ion-slides pager (change)="onSlideChanged($event)" (slideChangeStart)="onSlideChangeStart($event)" loop="true"> <ion-slides pager (change)="onSlideChanged($event)" (slideChangeStart)="onSlideChangeStart($event)" (move)="onSlideMove($event)" loop="true">
<ion-slide> <ion-slide>
<h3>Thank you for choosing the Awesome App!</h3> <h3>Thank you for choosing the Awesome App!</h3>
<div id="logo"> <div id="logo">