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

accordion events #556

Closed
viskin opened this issue May 29, 2016 · 7 comments · Fixed by #2619
Closed

accordion events #556

viskin opened this issue May 29, 2016 · 7 comments · Fixed by #2619

Comments

@viskin
Copy link

viskin commented May 29, 2016

I want to do things when user switches accordion-groups of accordion component. Say, I want to save in application state information about which accordion-group is currently open.

Maybe I missing something in the way angular2 does things, but I think this kind of behavior could be achieved with events. Some kind of event like isOpenChanged for accordion-group seems missing to me.

How can I bind some code to user actions of opening and closing accordion groups? Am I right that events are missing?

@cescoferraro
Copy link

@viskin you need to bind an isopen variable to a service. So you can keep application state when a component get destroyed

@valorkin
Copy link
Member

valorkin commented Jun 1, 2016

Events model update is coming :)

@viskin
Copy link
Author

viskin commented Jun 1, 2016

@valorkin , looking forward to events model! :)

@figuerres
Copy link

has the events model been created ??

@figuerres
Copy link

@cescoferraro hey i am still figuring out angular 2 can you give me some idea how to do this??
i have an accordion with say 8 groups one for each state in part of the USA.
when the user clicks to open i need to know which state they opened ...
i have written services that get data from json files but i am not sure what you mean in this case ??

i have an event emit and an event subscribe to hook up i just need the last bit....

@cescoferraro
Copy link

@figuerres

Set a variable inside a service that holds the current tab name. It could be a string. Whenever you open a tab you should set its name as a variable inside the service you have created, Dont forget to set the default name for the main tab. Then you can query the actual variable value whenever you want inside your application.

You could use ngrx if you wish a better approach for keeping your the app state.

@brulejr
Copy link

brulejr commented May 6, 2017

What's the status of the events model for the Accordion?

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

Successfully merging a pull request may close this issue.

5 participants