ngGallery icon indicating copy to clipboard operation
ngGallery copied to clipboard

Implemented a delete action as per #41

Open tomchinery opened this issue 8 years ago • 1 comments

Can now delete an image by setting delete-icons to true and clicking the delete icon on either the thumbnail or gallery. Confirms with the user if they want to delete the image. Will go to the last image in the array after the delete action has occurred. A on-delete callback has also been implemented. Supports edge cases such as an empty images array.

Example usage:

<ng-gallery images="ctrl.images" delete-icons="true" on-delete="ctrl.callback()"></ng-gallery>

tomchinery avatar May 09 '16 17:05 tomchinery

Can you post an example of how to use the onDelete callback from the angularjs controller? The callback isn't being called in the controller when I use your implementation.

It's almost as if scope.onDelete({image: image}); isn't actually calling the callback function defined in the controller (passed into the directive as such: <ng-gallery images="images" onDelete="imageDeletedFromGallery()" ng-if="images.length"> </ng-gallery>

EDIT:

Nevermind, I found the solution to my problem here

http://stackoverflow.com/questions/19215007/angularjs-passing-a-function-to-an-isolated-scope-of-a-directive-to-be-called

prcbass avatar May 23 '16 02:05 prcbass