0
我試圖做出與谷歌形式相同的功能,這是當用戶選擇不同的問題類型時,它會顯示不同的數據輸入風格,如文本,段落文本,選擇。angularjs數據綁定與按鈕不工作
這裏是我的code鏈接:
我的問題是,當我選擇問題類型之一,這是行不通的,可以追溯到去年的狀態。
我不知道爲什麼。
這裏是我的代碼部分:
<tr>
<th>
<label class="question_label">Question Type</label>
</th>
<td>
<select class="question_dropdown" ng-model="question.type">
<option value= "text">Text</option>
<option value= "paragraph">Paragraph Text</option>
<option value= "radio">Multiple Choice</option>
<option value= "checkbox">Checkboxes</option>
<option value= "list">Choose from a list</option>
</select>
</td>
</tr>
</tbody>
</table>
<div class="question_typeContainer" ng-switch="question.type">
<div class="question_typeText" ng-switch-when="text">
<input class="question_textfield disabled" value="Their answer" disabled>
</div>
<div class="question_typeText" ng-switch-when="paragraph">
<input class="question_textfield disabled" value="Their answer" disabled>
</div>
</div>
我在項目的每個元素中添加了額外的鍵,它的工作原理。還有其他不錯的方法嗎? – Justin
閱讀關於範圍隔離。 –