This component is designed for use with Angular 1.2.x - 1.3x and the Twitter Bootstrap 3.x. It creates a bindable button dropdown (see Bootstrap components: Button dropdowns that looks like a Bootstrap btn
and behaves like an HTML <select>
tag.
You can see a demo in JS Fiddle here:
- Basic configuration (displaying a set of strings)
- Advanced configuration (displaying a set of objects)
You can install bootstrapSelectButton using Bower:
bower install bootstrap-select-button
Next you'll need to include the bootstrapSelectButton
module in your application.
Lastly, simply add the following attributes to a any DOM element:
<div bootstrap-select-button
options="bindableOptionsSet"
selected-option="bindableSelectedOption">
</div>
- options: Set (Array) of Strings or Objects
- selectedOption: Bindable attribute to store the selected option
- optionIconKey: Optional icon attribute if
options
Array contains Objects; defaults toicon
- optionLabelKey: Optional label attribute if
options
Array contains Objects; defaults tolabel
- dropdownToggleClass: Optional button class for the dropdown toggle; defaults to
btn-default