Ngx-bootstrap: accordion events

Created on 29 May 2016  路  7Comments  路  Source: valor-software/ngx-bootstrap

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?

comp(accordion)

Most helpful comment

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

All 7 comments

@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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

webdev48 picture webdev48  路  3Comments

srjkrl20011991 picture srjkrl20011991  路  3Comments

mounthorse-slns picture mounthorse-slns  路  3Comments

phmello picture phmello  路  3Comments

juanitavollmering picture juanitavollmering  路  3Comments