UPDATE: I have successfully resolved my issue. Thanks for the assistance, everyone.
I am working with an array of JSON objects that are structured like so:
[{"id":"id1", "text":"text1"}, {"id":"id2", "text":"text2"},....]
My goal is to populate an AngularJS select box using these objects, where the text values display in the dropdown and the id values are bound to the model. However, I am struggling to figure out the correct approach.
Currently, this is what my select code looks like, but it does not show anything:
<select name="field" ng-model="npe.formData.field" ng-options="field.id as field.text for field in fields">
If I use ng-options in a different way, I can get items to display, but the value binding to the model is incorrect:
ng-options="field as field.text for field in fields"
I have come across suggestions to use "(key, value)", but I am struggling to understand how it should be implemented.