Im trying to create a form with dynamic fields to create a JSON to post like this
{
"cpu": "1",
"ram": "128",
"env": {
"envname1": "value1",
"envname2": "value2"
}
}
While i have no problem to create cpu and ram i can not figure out to create "envname" and "value" because envname should be in a dynamic added field the first column and the value in second column.
I also can not get the regular fields and the dynamic fields together in one scope.
Please have a look at http://jsfiddle.net/q9dcn7wj/3/ cpu and ram fields are ignored. When i change
$scope.inputs = [{id: 'choice1'}];
to
$scope.inputs = {id: 'choice1'};
the dynamic fields are ignored. How do i get everything in the scope to submit the whole form as JSON?
cpu,ramandenv? Onlyenv? (according to your fiddle) Why do you display two text fields per env property?envi can add/remove with a click on a button. the user can add as manyenvvalues as he want in the form ofenvnameandvalue.