Currently, I am utilizing the uib-accordion directive and I aim to include a button that can expand or close all elements within the accordion. Here is the code snippet I have written:
<uib-accordion close-others="false">
<div align="right">
<a href="" ng-click="showFunc = !showFunc"> {{ showFunc ? "Hide all" : "Show all" }} </a>
</div>
<uib-accordion-group is-open="showFunc" ng-repeat="fun in functions" heading="{{ fun.name }}" is-disabled="!fun.show">
</uib-accordion-group>
When it comes to clicking on the expand all button, it works fine unless you click on each panel individually. This action creates the showFunc variable inside the scope of the panel, which the is-show directive then retrieves.
Any suggestions on how this could be better implemented? Currently, my Angular version is 1.6.2.
Thank you.