Failed to use delegate-handle for several instances of ion-slide-box
See original GitHub issueI have 3 ion-slide-box
. Everyone has 3 items.
I created two buttons Next
and back
to simulate sliding by pressing them.
However delegate-handle
doesn’t work. I get:
Delegate for handle "slider1" could not find a corresponding element with delegate-handle="slider1"! next() was not called!
Sounds like delegate-handle
doesn’t register properly the instance ids.
This is what I have so far:
scope.nextSlider = function(sliderId){
$timeout(function(){
$ionicSlideBoxDelegate.$getByHandle(sliderId).next();
}, 1000);
}
scope.prevSlider = function(sliderId){
$timeout(function(){
$ionicSlideBoxDelegate.$getByHandle(sliderId).previous();
}, 1000);
}
Template
<ion-slide-box delegate-handle="{{sliderId}}"
on-slide-changed="slideHasChanged(index)"
show-pager="false">
<ion-slide ng-repeat="color in colors">
<!-- -->
</ion-slide>
</ion-slide-box>
And this is a DEMO I play with
The issue was posted in Ionic Forum
Issue Analytics
- State:
- Created 9 years ago
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Failed to use delegate-handle for several instances of ion ...
I have 2 ion-slide-box. Everyone has 3 items. I created two buttons Next and back to simulate sliding by pressing them.
Read more >Ionic (angularjs) ion-slide-box with ng-repeat not updating
I have an ion-slide-box using ng-repeat showing images that are fetched from a remote server. <ion-slide-box on- ...
Read more >Slide-box Dynamic Height - #20 by JonathanAquino - ionic-v1
Given a long text string, how can I paginate it across multiple slides? The number of characters per page is determined by container...
Read more >Ionic Framework features you may have missed
Delegation allow you to have several instances of the same component within the same view. You have this capability on ion-side-menus, ion-tabs, ...
Read more >How To Create An Advanced Ionic Gallery with Image Zooming
Take a look at everything, from outside to inside: The outer div is a wrapper for our modal view with some background styling;...
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 Free
Top 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
An universal directive to use random-generated delegate-handle (inspired to @mikesurowiec ) :
}]);
use:
I had a similar problem and asked it in StackOverflow and got a great temporary solution to the problem. See it at StackOverflow. So basically set and get the delegate-handle by id of the container.
Hopefully this can help someone in the future.