I am working on an angular project where I need to create a form based on an array of questions. I would like to create ng-model
for each question in the array.
So I have come up with something like the following, but it is not working.
<div class="form-group" data-ng-repeat="question in questions">
<label for="{{question.label}}" class="col-md-2 control-label">
{{question.label}}:
</label>
<div class="col-md-10">
<input type="text"
class="form-control"
name="{{question.label}}"
data-ng-model={{question.label}}
required />
<span class="error"
data-ng-show="formQuickView.{{question.label}}.$error.required">
Required!
</span>
</div>
</div>
Could someone help me out for this one ?
Thanks heaps in advance.