Accordion or Tab, Browser Back button action and opening/selecting the corresponding item
I have used ui-router to load corresponding partial/template when user click item in accordion. its working fine.
But I am getting the following error whenever click any item.
Error: [$compile:nonassign] Expression '$state.includes('customers')' used with directive 'accordionGroup' is non-assignable!
I am getting the error in the below line. The following condition is used for opening/selecting the corresponding item whenever user click browser back button. How can i fix this?
is-open="$state.includes('customers')"
I want to fix the above issue/error inside partial/template itself. I don't want to fix this using controller code.
Demo: http://plnkr.co/edit/JuPEsu?p=preview
Thank you!
@mail2asik This is the expected behaviour. The expression you pass to the is-open attribute needs to be assignable. It is set to false in order to close the accordion group when required.
It is used a 2 places in the code: When you click on the accordion header to close it (https://github.com/angular-ui/bootstrap/blob/master/src/accordion/accordion.js#L85)
When the option close-others is set true (default behaviour) within the AccordionController(https://github.com/angular-ui/bootstrap/blob/master/src/accordion/accordion.js#L18)
You will not be able to avoid your error within you markup/template. Closing for now. Regards.
Ok! thank you Antoine!