1
如何訪問模型中「名稱」屬性生成的動態值。以下是代碼:AngularJs,訪問模型中的動態值
<tbody ng-repeat="que in backgroundInfo.questions">
<tr>
<td>{{que.id}} {{que.text}}</td>
<td>
<input type="radio" name="{{que.id}}" value="Yes" ng-model="backgroundInfo.questions.answer"/>Yes
<input type="radio" name="queid" value="No" ng-model="backgroundInfo.questions.answer"/>No
<textarea name="comment{{que.id}}" ng-model="backgroundInfo.questions.comment[que.id]" rows="2"
cols="45"/>
</td>
</tr>
</tbody>
你的問題不是很清楚,但是你不希望被綁定到'que.answer'而不是'backgroundInfo.questions.answer'嗎?在前者中,每個「que」都會有一個答案,在後者中,對整個團隊只有一個答案。 – Claies