I have a list of question that user has to answer.For that a have prepared a form. I get the number many comment textarea.Now whatever i type on first box i get in second.
The html form is
<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" ng-model=answer.comments></textarea>
</label>
</div>
<button type="submit" class="button button-positive" ng-click="feedback()"> Submit</button>
<form>
In my contoller i have define
$scope.answer=t={};
$scope.feedback=function(){
var a =t;
console.log(a);
}
The other problem is i want the question id and its comment be posted so i have defined the variable $scope.answer so that i get it in array format like the one below.But i get error in the console
answer=[
{
"questionid": "6"
"comments": "blah blah"
},
{
"questionid":7
"comments":"blah blah"
}]