Select ng-options is dont reset with '<input type="reset"> ' #14892
Description
Note: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When I have a select with ng-options with an array with objects, the behavior is weird when I reset the form by clicking in a <input type="reset" value="clear">
The problem occurs because when you select an option angular put a attribute selected="selected"
on the option and never clears the attribute in the others options.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
Chosse different options in the select and then press the reset button.
You can watch the error here: https://plnkr.co/edit/Epq5fVrS0I6p2csrntli?p=preview
What is the expected behavior?
The standard reset form button works properly
What is the motivation / use case for changing the behavior?
The standard reset form button doesn't works properly when ng-options is used with a array with objects.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
1.5.5, 1.5.7
Other information (e.g. stacktraces, related issues, suggestions how to fix)
The partial solution of this issue is commenting the line of the angular.js 1.5.5
28012 // option.element.setAttribute('selected', 'selected')
;