w11k-dropdownToggle is an AngularJS directive which offers advanced control of Bootstrap dropdowns.
Features:
- Toggle dropdown by click
- Automatically close open dropdown on opening another
- Programatically open and close dropdown from controller
- Prevent closing dropdown via event listener (e.g. containing invalid form)
- Install via Bower (w11k-dropdownToggle) or download manually from our release repository (https://github.com/w11k/w11k-dropdownToggle-bower)
- Include script into your application
- Add dependency to w11k-dropdownToggle module
<div class="dropdown">
<div w11k-dropdown-toggle="dropdown">
...
</div>
<div class="dropdown-menu">
...
</div>
</div>
Attribute w11k-dropdown-toggle
activates the directive. It can reference an object in the current scope which is used to expose some functions (open, close, toggle, isOpen) to programatically control the dropdown.
To run the included demo install bower components via bower install
and open demo/demo.html
with your browser.
see milestones and issues at https://github.com/w11k/w11k-dropdownToggle/issues
MIT - see LICENSE file