mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00
test(slides): added the slideChangeStart event to the intro test
This will now change the navbar button text before the slide is shown. References #5301
This commit is contained in:
@ -14,12 +14,19 @@ class MyApp {
|
|||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
class IntroPage {
|
class IntroPage {
|
||||||
constructor(nav: NavController) {
|
continueText: string = "Skip";
|
||||||
this.nav = nav;
|
|
||||||
|
constructor(public nav: NavController) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSlideChanged(slider) {
|
onSlideChanged(slider) {
|
||||||
console.log('Slide changed', slider);
|
console.log("Slide changed", slider);
|
||||||
|
}
|
||||||
|
|
||||||
|
onSlideChangeStart(slider) {
|
||||||
|
console.log("Slide change start", slider);
|
||||||
|
slider.isEnd ? this.continueText = "Continue" : this.continueText = "Skip";
|
||||||
}
|
}
|
||||||
|
|
||||||
skip() {
|
skip() {
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<ion-navbar *navbar>
|
<ion-navbar *navbar>
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<button (click)="skip()">
|
<button (click)="skip()">
|
||||||
Skip
|
{{continueText}}
|
||||||
</button>
|
</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-title>Slides</ion-title>
|
<ion-title>Slides</ion-title>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-slides pager (change)="onSlideChanged($event)" loop="true">
|
<ion-slides pager (change)="onSlideChanged($event)" (slideChangeStart)="onSlideChangeStart($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">
|
||||||
|
Reference in New Issue
Block a user