我正嘗試使用AngularJS材質構建表單,並且遇到了讓我的下拉選項出現的問題。我的HTML位於下方,我的選項存儲在服務器腳本的對象數組中。我在下面做錯了什麼?AngularJS材質下拉選項不起作用
<md-input-container class="md-block" flex-gt-sm ng-switch-when="choice">
<label for="{{element.section_element_name}}">{{element.section_element_label}}</label>
<md-select id={ {element.section_element_name}} type="selectbasic" value={{element.q_value}}>
<md-option ng-repeat="option in element.section_element_choices" value="{{option.element_choice_value}}">
{{option.element_choice_label}}
</md-option>
</md-select>
</md-input-container>
您CAND添加元對象的爲例? –
首先你應該在你的md-select標籤中加入ng-model =「selectedItem」 –