Deleting an item after swipe to delete?


#1

Are there any Ionic recipes for deleting an item in a list view? I’d like to remove the item from my bound Angular model (which is easy enough to do with its ng-repeat $index), then animate the row to slide up like when you delete an email in the iOS default Mail app.

Also, is there a way to close a swiped list item? I’d like to be able to “close” the opened swiped rows whenever another item is swiped (again, like iOS default apps do natively).


#2

You just need to write a handler that will remove an item from the object which you used in ng-repeat. The thing is, ng-repeat provides certain animations on events like resorting of deleting an item. You can find its description in Angular docs: http://docs.angularjs.org/api/ng/directive/ngRepeat (section “Animations”)


#3

You can use angular-hammer which provides swipe, pinch and other very interesting functionality.