angular-velocity
angular-velocity copied to clipboard
Issue in sub ng-repeat?
This has been working for me everywhere else, except here I seem to have an issue I cant figuire out - it's very straight forward I am using it like so -
Then there is a sub repeat which has flip left and right functions, which just pass the current and parent index, which toggles a show.
For example - here is the flip right
$scope.flipSideRight = function(index, parent){
var idx = index + 1;
if(idx >= $scope.contentHereCurrent[parent].sides.length){
idx = 0;
}else{}
if($scope.contentHereCurrent[parent].sides[idx].sideIs == 'help'){
$scope.flipSideRight(idx, parent); //Added to skip over to next item
$scope.contentHereCurrent[parent].sides[index].active = false;
return; // Added to skip execution of following line of codes incase of recursion
}else{}
$scope.contentHereCurrent[parent].sides[index].active = false;
$scope.contentHereCurrent[parent].sides[idx].active = true;
};
This is retuning undefined is not a function in the console - line 139 of angular-velocity which is $el.velocity(animation, opts); .Could this be because its a sub repeat? Thanks very much!
@ajmajma hey thanks for reporting this, could you provide a small snip of the HTML context and data or a working plunker?
Thanks! On 6 Jan 2015 17:24, "ajmajma" [email protected] wrote:
This has been working for me everywhere else, except here I seem to have an issue I cant figuire out - it's very straight forward I am using it like so -
Then there is a sub repeat which has flip left and right functions, which just pass the current and parent index, which toggles a show.
For example - here is the flip right
$scope.flipSideRight = function(index, parent){
var idx = index + 1; if(idx >= $scope.contentHereCurrent[parent].sides.length){ idx = 0; }else{} if($scope.contentHereCurrent[parent].sides[idx].sideIs == 'help'){ $scope.flipSideRight(idx, parent); //Added to skip over to next item $scope.contentHereCurrent[parent].sides[index].active = false; return; // Added to skip execution of following line of codes incase of recursion }else{} $scope.contentHereCurrent[parent].sides[index].active = false; $scope.contentHereCurrent[parent].sides[idx].active = true; };
This is retuning undefined is not a function in the console - line 139 of angular-velocity which is $el.velocity(animation, opts); .Could this be because its a sub repeat? Thanks very much!
— Reply to this email directly or view it on GitHub https://github.com/cgwyllie/angular-velocity/issues/15.
@cgwyllie this is sort of a mess - i run it through packery and have a recompile call for the content when it is loaded in. I pulled it off, but basically I had it on the first repeat you see with class="front", I would just tack the opposites onto that -
http://plnkr.co/edit/7SvsH6J5srjdAD0wA5nu?p=catalogue
Just to follow up on this a little bit - I think this has to do with sub or recursive repeats because I have run into the same issue on a separate problem. Thanks!