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'
})
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() {

View File

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