I have the following types:
$scope.types = [{
name: 'First',
desc: 'first desc'
},{
name: 'Second',
desc: 'second desc'
}]
I create a select:
<div>
<select ng-model="object.type" ng-selected="type.name" ng-options="type.name for type in types"></select>
</div>
And my model looks like this:
$scope.object = {type: 'First'};
When I set that model the select box is not selected to the correct element. Pretty sure I know exactly why this is happening. My type list is a list of objects and my model.type is just a string not an object. I really do want my types to have the extra 'desc' information and cannot change the model. Is there a way to set-up my select such that it works?