You can use a custom filter to do what you want. Check this blog post that describe the filter: http://justinklemm.com/angularjs-filter-ordering-objects-ngrepeat/
On Friday, January 18, 2013 8:48:30 AM UTC-5, Mike Brennan wrote: > > > > 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> > > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
