You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 10, 2018. It is now read-only.
Im using ng-repeat to render slides.
The list of slides is retrieved from ajax request result. The same time Im setting carouselIndex.
As a result I have carouselIndex is set to -1. This is because
scope.$watchCollection(repeatCollection, function(newValue, oldValue) {
occures later than
scope.$parent.$watch(indexModel, function(newValue, oldValue) {
so as a result i have "newValue = slidesCount - 1" and this is "-1" because slidesCount is zero.
Expected behavior: carouselIndex should be exact the same that I set in my code.
The text was updated successfully, but these errors were encountered:
I have 7 items in the carousel, with the item at index 6 selected.
I update the ng-repeat model with a list that has 37 items, which includes the original 6 items.
I change the rn-carousel-index value to 30 (the new index of the item that was at index 6)
What happens is that the repeatCollection hasn't been updated yet, so when I set the rn-carousel-index value to 30 the indexModel gets set to 6 (length - 1). The carousel then displays the item at index 6, which is not the item I wanted to have displayed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Im using ng-repeat to render slides.
The list of slides is retrieved from ajax request result. The same time Im setting carouselIndex.
As a result I have carouselIndex is set to -1. This is because
scope.$watchCollection(repeatCollection, function(newValue, oldValue) {
occures later than
scope.$parent.$watch(indexModel, function(newValue, oldValue) {
so as a result i have "newValue = slidesCount - 1" and this is "-1" because slidesCount is zero.
Expected behavior: carouselIndex should be exact the same that I set in my code.
The text was updated successfully, but these errors were encountered: