我有一个选择列表,其中默认选择一个选项为ng-selected。 当选择默认选项值并通过post方法提交时,它不会出现在post变量中。当我更改为其他一些选项并返回时它工作正常。
<select class="form-control" ng-model="newItem.if_unmard_rsn">
<option value="Under age" ng-selected="'Under Age'">Under Age
</option>
<option value="Health Issue">Health Issue
</option>
<option value="Economical Issue">Economical Issue
</option>
<option value="No reason">No Reason
</option>
</select>
答案 0 :(得分:0)
试
<select class="form-control" ng-model="newItem.if_unmard_rsn" ng-init="newItem.if_unmard_rsn='Under Age'">
<option value="Under age" >Under Age
</option>
<option value="Health Issue">Health Issue
</option>
<option value="Economical Issue">Economical Issue
</option>
<option value="No reason">No Reason
</option>