Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented a delete action as per #41 #43

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

tomchinery
Copy link

@tomchinery tomchinery commented May 9, 2016

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>

@prcbass
Copy link

prcbass commented May 23, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants