我有問題表單,在他們的問題有多選項。如何獲得用戶選擇的選項?如何以angularjs形式獲取多個單選按鈕值?
這是代碼?
...
<ul>
<li ng-repeat="question in questionPaper.questions">
<div>{{question.description}}</div>
<ul>
<li ng-repeat="option in question.options">
<span>
<input type="radio" name="option_question_{{question.id}}" ng-model="option.id"/>
{{option.description}}
</span>
</li>
</ul>
</li>
</ul>
...
如何獲取選項的值,
{question_paper_id: 1, answers: [{question_id: 1, options_id: 23}, {question_id: 2, options_id: 21}, {..}] }
這是我在plnkr代碼http://plnkr.co/edit/OTDsUUCiDGYfxJ2AMzFR
謝謝@zsong。有用。 – Prasanna 2014-09-24 10:18:05