This repository was archived by the owner on Apr 30, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,12 @@ _Example radio field_
260260##### optionsAttr (string, optional)
261261> ` optionsAttr ` is what is used as the attribute ngOptions will be applied to. Defaults to ` ng-options `
262262
263+ ##### notNull (boolean, optional)
264+ > ` notNull ` whether to add an empty null option
265+
266+ ##### nullDisplay (string, optional)
267+ > ` nullDisplay ` Null option label
268+
263269##### ngOptions (string, optional)
264270> If provided, this is used instead of the default ` ng-options ` giving you full control (and rendering the other options uncessisary.
265271
Original file line number Diff line number Diff line change 11export default ngModule => {
22 ngModule . config ( addSelectType ) ;
33
4- const template = `<select class="form-control" ng-model="model[options.key]"></select>` ;
4+ const template = `<select class="form-control" ng-model="model[options.key]">
5+ <option ng-hide="to.notNull" value="">{{to.nullDisplay}}</option>
6+ </select>` ;
57
68 function addSelectType ( formlyConfigProvider ) {
79 formlyConfigProvider . setType ( {
@@ -25,7 +27,9 @@ export default ngModule => {
2527 optionsAttr : check . string . optional ,
2628 labelProp : check . string . optional ,
2729 valueProp : check . string . optional ,
28- groupProp : check . string . optional
30+ groupProp : check . string . optional ,
31+ notNull : check . boolean . optional ,
32+ nullDisplay : check . string . optional
2933 }
3034 } )
3135 } ) ;
You can’t perform that action at this time.
0 commit comments