EDIT: My code actually does work, I was just being an idiot with an unrelated problem. Thanks for your input everyone.
So I have an array of JSON objects formatted like this:
[{"id":"id1", "text":"text1"}, {"id":"id2", "text":"text2"},....]
I want to populate an AngularJS select field using these, with the text fields as the display text and the id fields as the values, or whatever binds to the model. I have looked around, but can't for the life of me figure out what I need to do.
Right now I have this for my select, which results in nothing displaying:
<select name="field" ng-model="npe.formData.field" ng-options="field.id as field.text for field in fields">
Doing ng-options this way results in things displaying, but obviously will result in the incorrect value binding to the model:
ng-options="field as field.text for field in fields"
I have seen people talking about using "(key, value)", but I can't wrap my head around how it works.


ng-optionsexample directive usages are fine.dutyOrgcoming from? Is it a part offield?