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'
|
||||
})
|
||||
class IntroPage {
|
||||
constructor(nav: NavController) {
|
||||
this.nav = nav;
|
||||
continueText: string = "Skip";
|
||||
|
||||
constructor(public nav: NavController) {
|
||||
|
||||
}
|
||||
|
||||
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() {
|
||||
|
@ -1,14 +1,14 @@
|
||||
<ion-navbar *navbar>
|
||||
<ion-buttons end>
|
||||
<button (click)="skip()">
|
||||
Skip
|
||||
{{continueText}}
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-title>Slides</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
<ion-content>
|
||||
<ion-slides pager (change)="onSlideChanged($event)" loop="true">
|
||||
<ion-slides pager (change)="onSlideChanged($event)" (slideChangeStart)="onSlideChangeStart($event)" loop="true">
|
||||
<ion-slide>
|
||||
<h3>Thank you for choosing the Awesome App!</h3>
|
||||
<div id="logo">
|
||||
|
Reference in New Issue
Block a user