相关疑难解决方法(0)

textArea在角度js中的双向绑定

我有一个用户必须回答的问题列表.为此,我准备了一个表格.

html表单是

<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>
Run Code Online (Sandbox Code Playgroud)

现在我的json字符串是

{
    "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"
            }
        ]
    }
 }
Run Code Online (Sandbox Code Playgroud)

现在当用户提交表单时,我应该收到用户发布的所有问题的评论.

javascript angularjs

2
推荐指数
2
解决办法
1万
查看次数

标签 统计

angularjs ×1

javascript ×1