In our application, we have some dropdowns that cannot utilize the ng-options directive. This is because we need to set the title attribute directly on the <options> tag, which is not supported by ng-options.
The reason behind needing the title attribute is due to Internet Explorer versions older than 9 cutting off values that are too long. These values are only visible when the title attribute is present (showing up on hover of the element).
To understand the issue better, take a look at the following JSFiddle:
http://jsfiddle.net/nstuart/nF7eJ/ (HTML Bit)
<div ng-app="myApp" ng-controller="MyCtrl">
<select ng-model="params.value">
<option value="">Any</option>
<option ng-repeat="v in options" value="{{v.value}}" title="{{v.name}}" ng-selected="{{v.value == params.value}}">{{v.name}}</option>
</select>
<p>{{params.value}}</p>
</div>
Currently, the select should have 'test3' preselected, but it defaults to an empty option instead. This occurs because the value of ng-model does not match any values in the ng-options list.
Any suggestions on how to resolve this issue? Is there a way to add titles to options generated by ng-options or any other solution available?
EDIT
I have updated the fiddle at: http://jsfiddle.net/nstuart/nBphn/2/ based on the feedback provided in the answer below.