This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,13 @@ var SelectController =
42
42
if ( self . unknownOption . parent ( ) ) self . unknownOption . remove ( ) ;
43
43
} ;
44
44
45
- // The "empty" option is one that has a value of '' and can be provided as a child of
46
- // the `select` element.
47
- // In the basic select, we only need to use this to make IE9 happy when we set the select's
48
- // value to '', but also ngOption uses this for its own purposes too.
45
+ // Here we find the option that represents the "empty" value, i.e. the option with a value
46
+ // of `""`. This option needs to be accessed (to select it directly) when setting the value
47
+ // of the select to `""` because IE9 will not automatically select the option.
48
+ //
49
+ // Additionally, the `ngOptions` directive uses this option to allow the application developer
50
+ // to provide their own custom "empty" option when the viewValue does not match any of the
51
+ // option values.
49
52
for ( var i = 0 , children = $element . children ( ) , ii = children . length ; i < ii ; i ++ ) {
50
53
if ( children [ i ] . value === '' ) {
51
54
self . emptyOption = children . eq ( i ) ;
You can’t perform that action at this time.
0 commit comments