I have a resource in AngularJS returning an object that looks something like this:
[
{
field: {
name: 'foo'
},
field_value: 'bar'
},
{
field: {
name: 'foo2'
},
field_value: 'bar2'
}
]
Each field name will be unique, and I want to be able to pull out values by name to populate a form. Something like this:
<input type="text" value="{{data.foo}}" /> # this should equal 'bar'
How can I filter that object to easily access the values? Or should I perform a transformation on the data first?