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:
Brandy Carney
2016-02-13 14:14:30 -05:00
parent 736140ccad
commit a997a4d118
2 changed files with 12 additions and 5 deletions

View File

@ -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() {

View File

@ -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">