How to switch current slide carousal using filter #2950
Replies: 3 comments 1 reply
-
@HCP-Applications Here is an example: https://stackblitz.com/edit/7kmd61?file=src%2Fapp%2Fcarousel-basic-demo.html When you filter the carousel you can change the mentioned page prop as you wish. The mentioned ChangeDetectionStrategy.OnPush strategy has a different purpose, you don't need it unless you try to optimize your component. |
Beta Was this translation helpful? Give feedback.
-
Thanks for reply. Basically I am trying for such filter that should work on labels and not category. I mean in your example if I choose "Laptop" from dropdown filter. Carousal should switch slider to "Laptop" and on pressing left "Chair" should come and on right "T-shirt". Sequence should be maintained. In my case I am able to get "Laptop" but my left-right button changes sequence. |
Beta Was this translation helpful? Give feedback.
-
I got it working by using activeIndex = 0 and while applying filter I used as activeIndex = filterPageIndex. |
Beta Was this translation helpful? Give feedback.
-
I am using full page as a carousal element, now I want to reset current visible page upon applying filter. I mean if current visible index is 3 when I select filter for index 7, carousal should show data of index 7 page and then next previous should also work as expected. I can get array reordered on filter but the carousal does not get updated. I have tried ChangeDetectionStrategy.OnPush but not working. Anybody has any idea on how to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions