angular-foundation-6
angular-foundation-6 copied to clipboard
any way to open and close the dropdown toggle programatically from my controller
I am trying to make key board shortcut to open a dropdown toggle is there is a way to open and close the dropdown toggle programatically from my controller
it could be isOpen variable add in the directive and watched if change change $ctrl.active
<dropdown-toggle is-open="<the model in my controller>">
<toggle>
<a class="dropdown button large">dropdown-toggles can also have links!</a>
</toggle>
<pane>
<ul class="menu vertical">
<li ng-repeat="(label, url) in linkItems">
<a href="{{url}}" target="_blank">{{label}}</a>
</li>
</ul>
</pane>
</dropdown-toggle>
Currently, the only way to open a drop down programmatically is to manually trigger a click event. The directive does expose a close function, it could expose an open function in the same way.