1

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"
       }]
1
  • Duplicate question, asked by another user and was answered here Commented Jun 7, 2014 at 7:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.