@@ -178,8 +178,8 @@ have been fixed. The breaking changes are comparatively minor and should not aff
178178Due to [7fda214c](https://github.com/angular/angular.js/commit/7fda214c4f65a6a06b25cf5d5aff013a364e9cef),
179179when `ngOptions` renders the option values within the DOM, the resulting HTML code is different.
180180Normally this should not affect your application at all, however, if your code relies on inspecting
181- the value property of `<option>` elements (that `ngOptions` generates) then be sure to [read the details]
182- (https://github.com/angular/angular.js/commit/7fda214c4f65a6a06b25cf5d5aff013a364e9cef).
181+ the value property of `<option>` elements (that `ngOptions` generates) then be sure
182+ to [read the details] (https://github.com/angular/angular.js/commit/7fda214c4f65a6a06b25cf5d5aff013a364e9cef).
183183
184184Due to [7fda214c](https://github.com/angular/angular.js/commit/7fda214c4f65a6a06b25cf5d5aff013a364e9cef),
185185when iterating over an object's properties using the `(key, value) in obj` syntax
@@ -205,9 +205,19 @@ In Angular 1.3.x, setting `scope.x = 200` would select the option with the value
205205</select>
206206```
207207
208- In Angular 1.4.x, the 'unknown option' will be selected. To remedy this, you can either initialize
209- the model as a string - `scope.x = '200'` - or implement a parser on `ngModel` that converts
210- the option string value to a `Number`.
208+ 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+ keep the model as a `Number`, you can do the conversion via `$formatters` and `$parsers` on `ngModel`:
211+
212+ ```js
213+ ngModelCtrl.$parsers.push(function(value) {
214+ return parseInt(value, 10); // Convert option value to number
215+ });
216+
217+ ngModelCtrl.$formatters.push(function(value) {
218+ return value.toString(); // Convert scope value to string
219+ });
220+ ```
211221
212222## Templating (`ngRepeat`, `$compile`)
213223
0 commit comments