I have a generic JSON structure like this
{
"parameters":
[
{
"key":"fieldName","posibleValues":["Val1,"Val2"],
"key":"anotherField","posibleValues":["ValA,"ValB"]
}
]
}
No I want to do something like this:
<div ng-repeat="parameter in parameters">
<ng-form name="paramForm">
{{parameter.key}}: <select ng-model="request.parameter.{parameter.key}" ng-option="..." />
</ng-form>
</div>
The problems comes with the
select ng-model="request.parameter.{parameter.key}"
So I want to setup a model that is named like "request.parameter.fieldName" (according to the "key" in the JSON structure.
Is this possible? Or do I have to help myself with a ng-change?
Thanks