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?
@viskin you need to bind an isopen variable to a service. So you can keep application state when a component get destroyed
Events model update is coming :)
@valorkin , looking forward to events model! :)
has the events model been created ??
@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....
@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.
What's the status of the events model for the Accordion?
Most helpful comment
What's the status of the events model for the Accordion?