Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

fix(select input, readme): Handle object options in select input #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ _Example radio field_
>The select field allows selection via dropdown using the select element.

##### options (array, required)
>`options` is an array of options for the select form field to display. Each option should be an object with a `name`(string). You may optionally add a `group` to some or all of your options.
>`options` it can be an array or an object:
- an array of options for the select form field to display. Each option should be an object with a `name`(string). You may optionally add a `group` to some or all of your options.
- an object with key an value pairs used in combination with ngOptions ([Example](http://jsbin.com/gikiji/3/edit?js,output)).

##### labelProp (string, optional)
>`labelProp` is what is used for what is shown to the user. Defaults to `name`
Expand Down
2 changes: 1 addition & 1 deletion src/types/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default ngModule => {
},
apiCheck: check => ({
templateOptions: {
options: check.arrayOf(check.object),
options: check.oneOfType([check.arrayOf(check.object), check.objectOf(check.string)]),
optionsAttr: check.string.optional,
labelProp: check.string.optional,
valueProp: check.string.optional,
Expand Down