Skip to content

Commit

Permalink
feat(slides): Added move event onSlideMove
Browse files Browse the repository at this point in the history
  • Loading branch information
edanweis committed Feb 9, 2016
1 parent 1a5821b commit daceb98
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ionic/components/slides/slides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {Scroll} from '../scroll/scroll';
* ```ts
* @Page({
* 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>
* <h3>Thank you for choosing the Awesome App!</h3>
* <p>
Expand Down Expand Up @@ -58,6 +58,7 @@ import {Scroll} from '../scroll/scroll';
* @property {Number} [zoomDuration] - how long it should take to zoom a slide
* @property {Number} [zoomMax] - the max scale an slide can be zoomed
* @property {Any} (change) - expression to evaluate when a slide has been changed
* @property {Any} (move) - expression to evaluate when a slide is moving
* @demo /docs/v2/demos/slides/
* @see {@link /docs/v2/components#slides Slides Component Docs}
*
Expand Down Expand Up @@ -214,6 +215,11 @@ export class Slides extends Ion {
*/
@Output() change: EventEmitter<any> = new EventEmitter();

/**
* @private
*/
@Output() move: EventEmitter<any> = new EventEmitter();

/**
* @private
* @param {ElementRef} elementRef TODO
Expand Down Expand Up @@ -282,6 +288,10 @@ export class Slides extends Ion {
options.onLazyImageReady = (swiper, slide, img) => {
return this.options.onLazyImageReady && this.options.onLazyImageReady(swiper, slide, img);
};
options.onSliderMove = (swiper, e) => {
this.move.emit(swiper, e);
return this.options.onSliderMove && this.options.onSliderMove(swiper, e);
};

setTimeout(() => {
var swiper = new Swiper(this.getNativeElement().children[0], options);
Expand Down

0 comments on commit daceb98

Please sign in to comment.