I have the following Object which contains Objets in itself:
var myObj = {
1:{
id:1,
name:'John',
otherVal='LoremIpsum'
},
2:{
id:2,
name:'Bill',
otherVal='LoremIpsum'
},
3:{
id: 3,
name:'Steve',
otherVal='LoremIpsum'
}};
I show the values of name
inside these object in an select field in the following way:
<select name="someName" ng-model="someModel"
ng-options="person.id as person.name for person in myObj"
<option value=""></option>
</select>
How can I sort the <option>
's alphabetically by the value name
?