JSFiddle: http://jsfiddle.net/L8m7ptm7/
I have an array of objects that represent questions I'd like to include within an Angular form:
$scope.questions = [
{
'name': 'question1',
'label': 'Question 1',
'value': null
},
{
'name': 'question2',
'label': 'Question 2',
'value': null
}
];
The questions are rendered correctly within the DOM - with name attributes of question1 and question2, as desired.
The trouble arises when attempting to read these field's values out of the myForm object. Run the fiddle, and you'll see what happens. Instead
of the form containing keys for question1 and question2, it contains a single key - {{question.name}}.
Is it possible to have these fields register with the form object using the desired (rendered) names?
