http://jsfiddle.net/mjb14/5PsWJ/1/
Rather than having a simple array of objects, I am using an object to power the <select> box. The fiddle has the select working fine, I am just having trouble getting the order by to work. Is it possible to sort on a key of a value? I need the data in this structure because I use it to do lookups. My alternative right now is to generate the data 2x in 2 different formats, but that isn't ideal.
$scope.metaData = {
"column": {
"application_id": {
"foreign_key_data": {
"1": {
"application_name": "mojo_rose",
"descr": "Mojo Rose framework project",
"application_id": "1"
},
"2": {
"application_name": "eas",
"descr": "EAS utility apps",
"application_id": "2"
},
"3": {
"application_name": "app_security",
"descr": "Application Security project",
"application_id": "3"
}
}
}
}
};
HTML:
<select id="form-application_id" ng-model="formData.application_id" ng-options="k as v.application_name for (k,v) in metaData.column.application_id.foreign_key_data" >
<option value=""></option>
</select>