Skip to content

Commit cec290e

Browse files
petebacondarwinnetman92
authored andcommitted
docs(migration): clarify non-numeric matching
Closes angular#12350
1 parent 18df6c3 commit cec290e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/content/guide/migration.ngdoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ in which the properties were defined.
194194

195195
Due to [7fda214c](https://github.com/angular/angular.js/commit/7fda214c4f65a6a06b25cf5d5aff013a364e9cef),
196196
the `select` directive will now use strict comparison of the `ngModel` scope value against `option`
197-
values to determine which option is selected. This means `Number` scope values will not be matched
198-
against numeric option strings.
197+
values to determine which option is selected. This means non-string scope values (such as `Number` or `Boolean`)
198+
will not be matched against equivalent option strings (such as the strings `"123"`, `"true"` or `"false"`).
199+
199200
In Angular 1.3.x, setting `scope.x = 200` would select the option with the value 200 in the following `select`:
200201

201202
```
@@ -206,7 +207,8 @@ In Angular 1.3.x, setting `scope.x = 200` would select the option with the value
206207
```
207208

208209
In Angular 1.4.x, the 'unknown option' will be selected.
209-
To remedy this, you can simply initialize the model as a string: `scope.x = '200'`, or if you want to
210+
211+
To remedy this, you can initialize the model as a string: `scope.x = '200'`, or if you want to
210212
keep the model as a `Number`, you can do the conversion via `$formatters` and `$parsers` on `ngModel`:
211213

212214
```js

0 commit comments

Comments
 (0)