angular-swing icon indicating copy to clipboard operation
angular-swing copied to clipboard

Destroying cards / fading them out

Open jcb121 opened this issue 9 years ago • 2 comments

Hi,

you've shown methods on how to add and remove cards but these methods only work if the cards are untouched.

I would like to be able to remove these cards on the throw out event handler. Is there a function like $scope.card[0].destroy()?

Thanks

jcb121 avatar Dec 31 '15 16:12 jcb121

@jcb121 Why don't you just remove them with the ChildNove.remove() method?

Like this:

$scope.throwout = function(eventName, eventObject) {
     eventObject.target.remove(); 
};

goncalomarques avatar May 05 '16 15:05 goncalomarques

@jcb121 in angular-swing.js line 514

Card.isThrowOut = function (offset, element, throwOutConfidence) { element.remove(); return throwOutConfidence === 1; };

add element.remove();

zwxiang avatar Aug 02 '16 05:08 zwxiang