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

Commit 5aff0c3

Browse files
committed
fix(select): Add additional configuration property for select field to change options attribute
1 parent e1ef07e commit 5aff0c3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ _Example radio field_
257257
##### groupProp (string, optional)
258258
>`groupProp` is what is used to group the options
259259
260+
##### optionsAttr (string, optional)
261+
>`optionsAttr` is what is used as the attribute ngOptions will be applied to. Defaults to `ng-options`
262+
260263
##### ngOptions (string, optional)
261264
>If provided, this is used instead of the default `ng-options` giving you full control (and rendering the other options uncessisary.
262265

src/types/select.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ export default ngModule => {
1414
return {
1515
ngModelAttrs: {
1616
[ngOptions]: {
17-
value: 'ng-options'
17+
value: options.templateOptions.optionsAttr || 'ng-options'
1818
}
1919
}
2020
};
2121
},
2222
apiCheck: check => ({
2323
templateOptions: {
2424
options: check.arrayOf(check.object),
25+
optionsAttr: check.string.optional,
2526
labelProp: check.string.optional,
2627
valueProp: check.string.optional,
2728
groupProp: check.string.optional

0 commit comments

Comments
 (0)