Viczei / ng2-swipe-cards

A kit of cards (including tinder-card) for angular2
MIT License
25 stars 18 forks source link

Undo deletion of element #33

Open ITServicesAM opened 7 years ago

ITServicesAM commented 7 years ago

Hi guys,

i'm trying to add a functionality to undo the deletion of the last liked/disliked element. There is a limited save space for the user you can say and if it is reached you can not save images on like anymore, until you delete some old images. so I want to prevent the last liked/disliked element from deletion. so the user can like this image if he has deleted some old images.

Is this possible? thx in advance :)

chrillewoodz commented 7 years ago

It is possible, but this is more a question for StackOverflow because it's not really an issue related to the module. If you open a question on StackOverflow instead I can try to help you. Preferably with a plunkr as well.

Viczei commented 7 years ago

@ITServicesAM I think that in order to get an undo functionality you could simply store in a variable a copy of the item representing the card beeing swipped. So if you want to undo the removal of the card (after releasing it), you could push the stored copy in the array.