ng2-swipe-cards
ng2-swipe-cards copied to clipboard
Removing cards using this.cards.shift() is causing issue on swipe effect on tapping like/dislike button
Removing cards using this.cards.shift()
is causing issue on swipe effect on tapping like/dislike button.
I am loading 3 cards initially and then removing cards one by one on swiping using this.cards.shift()
and also pushing a card on each removal using this.cards.push(....)
. Also instead of using cardCursor, I am always removing card at 0th index and adding one card at the end(Index 2) at the same time on swiping.
After using .shift()
method, when we try to swipe the card then the swipe effect works but when we use like/dislike button then the swipe effect is not getting shown and the card is getting removed abruptly with no effect. What could be the possible reason?
And thanks a lot for such a nice module.
Fire the like event on the card before shifting your stack: card.likeEvent.emit({ like });
what is card in the above line @Sjerd. Is it the viewchild of sc-card?