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

Commit 1f4aa47

Browse files
docs(migration): clarify non-numeric matching
Closes #12350
1 parent 528ceda commit 1f4aa47

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/content/guide/migration.ngdoc

+6-4
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
@@ -248,7 +250,7 @@ is marked as optional and the attribute is not specified, no function will be ad
248250

249251
Due to [62d514b](https://github.com/angular/angular.js/commit/62d514b06937cc7dd86e973ea11165c88343b42d),
250252
returning an object from a controller constructor function will now override the scope. Views that use the
251-
controllerAs method will no longer get the this reference, but the returned object.
253+
controllerAs method will no longer get the this reference, but the returned object.
252254

253255

254256
## Cookies (`ngCookies`)

0 commit comments

Comments
 (0)