pedroabreu / ion-gallery

Ionic gallery directive
MIT License
124 stars 61 forks source link

how do I delete an image thats displayed in ion-gallery #33

Closed jessonjoy closed 8 years ago

jessonjoy commented 8 years ago

I want to display images but also have ability to delete them from the UI and the backing array..

ggoforth commented 8 years ago

+1

Seems like you would need some other interface (in the current state of the app) to remove an image, which doesn't make much sense.

pedroabreu commented 8 years ago

You just need to remove images from the array you pass to the directive. Don't think it would make much sense to have that method in the directive but, of course, open for discussion

b3na commented 8 years ago

I made a custom directive to simulate a select/delete view, basically what it does is to add a css class to the item (red background) and push it to another array, then if you tap on it again, i remove the css class and splice the array. Then when the user taps on delete, I delete the items on the new array out of the original photos array.

Here is a GIF with the functionality:

Image of Yaktocat I don't know if this is what you meant for deleting functionality, but I can share my code if it works for you.

Adoniasv commented 8 years ago

+1

hshaukat commented 8 years ago

+1 Nice work -- any chance to share the source code?