我正在从api返回看起来像这样的数据:
[
{
createDate:'somedate',
updateDate:'someOtherDate',
id: 'abx123ef2D-00-4d256d', //this is a Guid
name: 'stateName'
},
{
createDate:'somedate',
updateDate:'someOtherDate',
id: 'a different Guid here', //this is a Guid
name: 'stateName'
}
]
这是我的选择列表:
<select id="State"
ng-model="viewmodel.newRegion.stateId"
class="form-control"
ng-options="state.id as state.name for state in viewModel.states">
<option value="">Select State</option>
</select>
但是当我去运行提交时,我没有任何newRegion.id。
任何人都可以帮忙吗?