这是我的代码,我想将动态对象用作ng-model:
<div class="form-group" ng-repeat="(key,value) in importdata.fields">
<label class="col-sm-3 control-label" >
{{value}}
</label>
<div class="col-sm-9">
<select ng-model="form.{{key}}" ng-options='column as column for column in importdata.columns' class="form-control"></select>
</div>
</div>
{{form | json }}
我想显示这样的结果:
{
name:'john',
family:'Doe'
}
或
{
name:'john',
family:''
}
答案 0 :(得分:1)