mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00

BREAKING CHANGES: Renamed all Ionic events to start with `ion`. The following events were renamed: - **Checkbox** - `change` -> `ionChange` - **DateTime** - `change` -> `ionChange` - `cancel` -> `ionCancel` - **InfiniteScroll** - `infinite` -> `ionInfinite` - **Menu** - `opening` -> `ionDrag` - `opened` -> `ionOpen` - `closed` -> `ionClose` - **Option** - `select` -> `ionSelect` - **Picker** - `change` -> `ionChange` - **RadioButton** - `select` -> `ionSelect` - **RadioGroup** - `change` -> `ionChange` - **Refresher** - `refresh` -> `ionRefresh` - `pulling` -> `ionPull` - `start` -> `ionStart` - **Searchbar** - `input` -> `ionInput` - `blur` -> `ionBlur` - `focus` -> `ionFocus` - `cancel` -> `ionCancel` - `clear` -> `ionClear` - **Segment** - `change` -> `ionChange` - `select` -> `ionSelect` - **Select** - `change` -> `ionChange` - `cancel` -> `ionCancel` - **Slides** - `willChange` -> `ionWillChange` - `didChange` -> `ionDidChange` - `move` -> `ionDrag` - **TabButton** - `select` -> `ionSelect` - **Tab** - `select` -> `ionSelect` - **Tabs** - `change` -> `ionChange` - **Toggle** - `change` -> `ionChange` Closes #6568
58 lines
1.0 KiB
TypeScript
58 lines
1.0 KiB
TypeScript
import {ViewChild} from '@angular/core';
|
|
import {App, Page, Slides} from '../../../../../src';
|
|
|
|
|
|
@App({
|
|
templateUrl: 'main.html'
|
|
})
|
|
class MyPage {
|
|
@ViewChild('mySlider') slider: Slides;
|
|
mySlideOptions = {
|
|
initialSlide: 1,
|
|
loop: false
|
|
};
|
|
|
|
ngAfterViewInit() {
|
|
|
|
}
|
|
|
|
onSlideChanged() {
|
|
let previousIndex = this.slider.getPreviousIndex();
|
|
let currentIndex = this.slider.getActiveIndex();
|
|
console.log("Previous index is", previousIndex, "Current index is", currentIndex);
|
|
}
|
|
|
|
onSlideMove(ev) {
|
|
console.log("Slide moving", ev);
|
|
}
|
|
|
|
goToPrevSlide() {
|
|
this.slider.slidePrev();
|
|
}
|
|
|
|
goToNextSlide() {
|
|
this.slider.slideNext();
|
|
}
|
|
|
|
goToSlide(index) {
|
|
this.slider.slideTo(index);
|
|
}
|
|
|
|
getIndex() {
|
|
let index = this.slider.getActiveIndex();
|
|
console.log("Current Index is", index);
|
|
}
|
|
|
|
getLength() {
|
|
let length = this.slider.length();
|
|
console.log("Current Length is", length);
|
|
}
|
|
}
|
|
|
|
@App({
|
|
template: `<ion-nav [root]="root"></ion-nav>`
|
|
})
|
|
class E2EApp {
|
|
root: any = MyPage;
|
|
}
|