Skip to content

Accordion callbacks #157

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

Open
per-frojdh opened this issue Nov 20, 2014 · 4 comments
Open

Accordion callbacks #157

per-frojdh opened this issue Nov 20, 2014 · 4 comments

Comments

@per-frojdh
Copy link

I was wondering if there's any way to achieve some sort of callback for the opening and closing of the accordion-groups. I tried the vanilla foundation ways, but didn't seem to get very far. Also tried $watching "isOpen", but it seemed to only fire once.

Thanks for all the work you guys put into this, very helpful for new developers like myself.

@paramburu
Copy link

I had a similar situation and solved it by attaching an ngClick directive to the accordion-group I needed. The drawback is that it would not get called if it is opened via other methods nor would tell you if it is being closed.

<accordion-group ng-click="myFunction()" heading="title">
    Accordion content.
</accordion-group>

@per-frojdh
Copy link
Author

Thanks for the input,

Sadly this also seems to register for all clicks within each accordion-group, specifically I've tried adding a ng-click event on the accordion-heading within each, but this doesn't seem to produce any results (my guess is that there's already some sort of event registered on the header).

For now I'll stick with your solution and see if I can restrict the functions inside the click-event depending on where it was registered.

@koosvanderkolk
Copy link

Subscribing

@creimers
Copy link

+1

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

No branches or pull requests

4 participants