uxxman / angular-accordion

A simple angular directive for adding accordion UI element
MIT License
54 stars 37 forks source link

Unable to use initally-open while getting title from the ng-repeat #27

Open dstvishnu opened 7 years ago

dstvishnu commented 7 years ago

when i tried to use the initially-open="true" while using ng-repeat to get the data for the itemTitle.It opens all the elements instead of the only one element

uxxman commented 7 years ago

It will obviously open all collapsibles because you are setting the initially-open="true" option as true. You can set initially-open value to be a variable or expression so it is only true for the item you want to be open initially.

dstvishnu commented 7 years ago

Why it is opening all the elements after setting one-at-a-time="true"?

uxxman commented 7 years ago

one-at-a-time="true" ensures that when a user opens a new collapsible, the other opened collapsible is closed automatically. It doesn't interfere with initially-open="true" value cause that depends on developer.

jolleychris commented 7 years ago

"You can set initially-open value to be a variable or expression so it is only true for the item you want to be open initially."

I cant seem to get this to work - could you give an example? I just want to open only the first item output from an ng-repeat