2-way binding of textArea in angular js

后端 未结 2 1447
迷失自我
迷失自我 2021-01-20 02:11

I have a list of question that user has to answer.For that a have prepared a form.

The html form is

2条回答
  •  日久生厌
    2021-01-20 02:45

    I am not angular expert, but I think you need to add ng-model to the textarea element.

    {{question.text}}

    And, you also need to add 'comments' field to each comment type question. Example:

            {
                "id": "6",
                "text": "how was it?",
                "type": "comment",
                "comments": ""
    
            }
    

    Note that you may not need to add "comments" field if there is a 'force add field' flag for angularjs that i'm not aware of.

提交回复
热议问题