Select Component
Name: fmSelect (Prefix Configurable)
Type: component
This component creates a <label> and a <select> control. The control and label will be assigned matching id and for attributes.
Bindings
| Name | Type | Description |
|---|---|---|
name |
@ |
Name of the control. |
placeholder |
@ |
Input placeholder (will be rendered as a null option). |
multiple |
@ |
Whether to render a single select or a multi-select. |
options |
@ |
Comprehension expression to pass to ngOptions. |
config |
< |
Control configuration object. (See: Control Configuration) |
ng-disabled |
< |
Expression to evaluate to determine if the component should be disabled. (Passed-through to the underlying <select> element.) |
API
This control extends the FormationControl class, and does not implement any additional methods.
Additional Behavior
- Transclusion: Transcluded content will be placed in the
<label>created by this component. - CSS
- The class
has-errorwill be applied to the<select>and<label>elements when the control has an error. - The class
is-pendingwill be applied to the<select>and<label>elements when the control is pending. - Disabling: The component can be disabled/enabled in any of four ways:
- The class
Example
<fm name="vm.myForm" controls="vm.controls">
<fm-select name="birthYear" options="year in vm.years">What year were you born in?</fm-select>
</fm>