[Ionic v4 with angular| Slides getActiveIndex, isBeginning and isEnd methods return not proper value
See original GitHub issueBug Report
Ionic Info
Run ionic info
from a terminal/cmd prompt and paste the output below.
Ionic:
ionic (Ionic CLI) : 4.0.1 (/Users/bilal/.config/yarn/global/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.0
@angular-devkit/core : 0.7.0-rc.3
@angular-devkit/schematics : 0.7.0-rc.3
@angular/cli : 6.0.8
@ionic/ng-toolkit : 1.0.0
@ionic/schematics-angular : 1.0.1
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : none
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
ios-sim : 6.1.2
NodeJS : v8.9.4 (/Users/bilal/.nvm/versions/node/v8.9.4/bin/node)
npm : 6.2.0
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000
Environment:
ANDROID_HOME : /Users/bilal/Library/Android/sdk
Describe the Bug
Slides getActiveIndex
,isBeginning
and isEnd
methods return not proper value. They return following:
ZoneAwarePromise {__zone_symbol__state: null, __zone_symbol__value: Array[0]}
Steps to Reproduce Steps to reproduce the behavior:
- Go to stackblitz example.
- Click on
Info
button. - Check console.
Related Code https://stackblitz.com/edit/ion-slides-info
Expected Behavior
getActiveIndex
method should return index value and isBeginning
and isEnd
method should return boolean value.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:11 (3 by maintainers)
Top Results From Across the Web
IONIC 4 : getActiveIndex() is not working in ion-slides
Using IONIC 4 ion-slides, I am trying to get currently clicked silde index using getActiveIndex() as below which it is not working.
Read more >IONIC 4 : getActiveIndex() is not working in ion-slides
Note that although it seems to work, I suspect that because the value is changes inside promise, it will only return the correct...
Read more >Getting Getactiveindex Wrong In Ionic Slider - ADocLib
... this behaviour. should contain the slide container, [Ionic v4 with angular| Slides getActiveIndex, isBeginning and isEnd methods return not proper.
Read more >Building a slideshow with Ionic Slides API - Mastering Ionic
In this coding tutorial we will walk through using the Ionic Slides API to create stunning slideshow components for our mobile applications ...
Read more >how to let the first slide appear after button click also in antd ...
length - 1; return ( <div className="carousel-button-group" style={{ position: "absolute" }}> <button onClick={() => currentSlide === 0 ? goToSlide( ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try this: https://stackblitz.com/edit/ion-slides-info-bzpu9s
app.component.html
app.component.ts
I’m not very familiar with Ionic Angular (or Angular in general), but it looks like you’ll have to use the
nativeElement
property to be able to fire off methods in any Ionic element.when viewing the app using ionic serve, the promise response works nicely (coded while in ionic serve). Then if run ionic build I get a compile error with error TS2339: Property ‘then’ does not exist on type ‘number’. I then have to convert to a normal assignment to either run ionic serve, or ionic build so it does not fail on build. slightly unusual behaviour. This was on 4.0.2. I’ve just upgraded to 4.06 so will retest.