Angular: Empty Fiddle
http://angularjs.org/
by IgorMinar
HTML
<script type="text/javascript" ng:autobind src="http://code.angularjs.org/angular-0.10.3.js"></script>
<select ng:model="fixedSelectVal" ng:options="item for item in ['a', 'b']">
</select>
<button ng:click="fixedSelectVal = 'xx'">fubar</button>
fixedSelectVal={{fixedSelectVal}}
JavaScript
/*
Steps to reproduce the issue:
- load the fiddle
- select "a"
- notice that model is correctly set to "a", but the view is set to "b" instead of "a"!!
- click the "fubar" button
- notice that the model is correctly set to "xx", but the view is set to "a" instead of blank!!
if "b" is selected as the first choice, everything works as fine, so it seems that removing the blank element confuses the browser/angular and it selects the wrong thing in the view.
*/