mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
chore(build): rename ionic directory to src and update all references in the build process.
This commit is contained in:
53
src/components/slides/test/controller/index.ts
Normal file
53
src/components/slides/test/controller/index.ts
Normal file
@ -0,0 +1,53 @@
|
||||
import {ViewChild} from '@angular/core';
|
||||
import {App, Page, Slides} from '../../../../../ionic';
|
||||
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user