I am trying to do a case-insensitive binding of an ng model to expanding a dropdown using AngularJS. Consider the select element:
<select id="animal" ng-model="ctrl.animal">
<option value="">--- Select ---</option>
<option value="Cat">Cat</option>
<option value="Dog">Dog</option>
</select>
If I install ctrl.animal="Cat"Angular in my controller, the binding works fine. The problem is that if I install ctrl.animal="Cat", it does not bind because the strings are not equal as a result of the difference in the case.
I also tried converting the attributes 'value'to all uppercase, but the binding still does not work. As in the sample:
<select id="animal" ng-model="ctrl.animal">
<option value="">--- Select ---</option>
<option value="Cat">Cat</option>
<option value="Dog">Dog</option>
</select>
, AngularJS ? , , "" , 'option'.
JSFiddle