我有以下标记:
<div ng-repeat="department in storeData.departments">
<p>{{department.currentManager.fullName}}</p>
<select ng-model="department.currentManager" ng-options="user.fullName for user in department.users"></select>
</div>
使用以下数据模型:
department : {
currentManager: {
fullName: 'bob',
id: '2'
}
users: [
{
fullName: 'mike',
id: '1'
},
{
fullName: 'bob',
id: '2'
}
{
fullName: 'jeff',
id: '3'
}
]
但是选择的默认选项始终为空白。这是因为 ng-model 不直接在选项数组中吗?我究竟做错了什么?