0
私は制御するパラメータを送信しようとしています。AngularJS ng-modelは、フォームを繰り返す際に問題が発生します。
ng-repeatには複数のタイプの質問、つまり「質問」があり、これらを繰り返しています。問題は、同じ質問タイプで2つの質問がある場合です。私が1つの質問に入力を与えると、もう1つの質問は同じデータを取っています。親切にもこれで私を助けてください。
以下はフォームです。
<div ng-repeat="question in qgroup[grp_id].question" name="outerDiv">
<div ng-if="question.question_type === 'short_text'" class="row form-group">
<label class="control-label label-pad-top col-sm-6" for="short-text">{{question.name}}:</label>
<div class="col-sm-12">
<input type="f-name" name="shortText" class="form-control" id="first-name" placeholder="First Name" ng-model="data.answer.shortText">
</div>
</div>
<div ng-if="question.question_type === 'date_format'" class="row form-group">
<label class="control-label label-pad-top col-sm-6" for="short-text">{{question.name}}:</label>
<div class="col-sm-12">
<input type="d-type" name="date" class="form-control" id="date-type" placeholder="YYYY/MM/DD" ng-model="data.answer.date">
</div>
</div>
</div>
問題は必ずしも発生しませんが、同じIDをドキュメント内に複数回使用することはできません。 –