To gather user responses to a list of questions, I created a form.
Here is the HTML form:
<div class="list" ng-repeat="question in questions.data.Question" >
<div class="item item-divider">
{{question.text}}
</div>
<label class="item item-input" ng-if="question.type =='comment'">
<textarea placeholder="Comments"></textarea>
</label>
</div>
Now, my JSON string looks like this:
{
"sucess": true,
"message": "record(s) fetched sucessfully",
"data": {
"Question": [
{
"id": "4",
"text": "how was it?",
"type": "comment"
},
{
"id": "6",
"text": "how was it?",
"type": "comment"
}
]
}
}
When the user submits the form, I need to capture the comments they provided for each question.