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.
The rnCarouselIndicators wasn't working for me because of a scoping context issue. In the line indexModel.assign(scope.$parent.$parent, index); .$parent.$parent has the wrong context, for the particular scope item I am specifying in the reCarouselIndex attribute. It's an unsafe assumption really, to say where that value will be scoped, in terms of parent hierarchy.
Since that param, is already a two way locally scoped item (signaled by '=' local scope declaration), am I missing something else, as to why you don't just assign the updated index straight into the local scoped index.
The following fixes my issue
//var indexModel = $parse(iAttributes.rnCarouselIndex);
scope.goToSlide = function (index) {
//indexModel.assign(scope.$parent.$parent, index);
scope.index = index;
};
Regards,
Kev
The text was updated successfully, but these errors were encountered:
Just to add to this, I tracked my problem down, to the requirement of the inclusion of the ng-if="slides.length > 1" in the original defining element. I wasn't using it, as I had static amount of items in the carousel, so didn't see the need for it. The inclusion of ng-if creates its own scope context, which means the the original scope.$parent.$parent will work.
Maybe the docs should be updated to signify ng-if is a requirement for indicator to work.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
The rnCarouselIndicators wasn't working for me because of a scoping context issue. In the line indexModel.assign(scope.$parent.$parent, index); .$parent.$parent has the wrong context, for the particular scope item I am specifying in the reCarouselIndex attribute. It's an unsafe assumption really, to say where that value will be scoped, in terms of parent hierarchy.
Since that param, is already a two way locally scoped item (signaled by '=' local scope declaration), am I missing something else, as to why you don't just assign the updated index straight into the local scoped index.
The following fixes my issue
//var indexModel = $parse(iAttributes.rnCarouselIndex);
scope.goToSlide = function (index) {
//indexModel.assign(scope.$parent.$parent, index);
scope.index = index;
};
Regards,
Kev
The text was updated successfully, but these errors were encountered: