我有这样的数据:
[{
"id": 1,
"organizationName": "psda",
"organizationNameEN": "psda",
},
{
"id": 1,
"organizationName": "psda",
"organizationNameEN": "psda",
}]
我希望tvalues,这个数据到我的表字段值,这是我的代码:
<tbody ng-repeat="item in arr" >
<tr>
<td><input style="width:25px; height:25px;" type="checkbox" ng-model="chekselct"
cam-variable-name="isItemSelected"
cam-variable-type="Boolean" /></td>
<td><input style="width:140px;" type="text" id="id" value= "{{item.id}}" readonly /></td>
<td><input style="width:305px;" type="text" id="organizationNameEN" value="{{item.organizationName}}" readonly/></td>
<td><input style="width:305px;" type="text" id="organizationNameEN" value="{{item.organizationName}}" readonly/></td>
<td><button type="button" class="btn btn-primary" style="height:25px">details</button></td>
</tr>
</tbody>
和它的例外情况无法阅读财产&#39;价值&#39;未定义的, 我应该改变什么来使这个代码工作?
答案 0 :(得分:0)
输入try ng-model
而不是value属性<tbody ng-repeat="item in arr" >
<tr>
<td><input style="width:25px; height:25px;" type="checkbox" ng-model="chekselct"
cam-variable-name="isItemSelected"
cam-variable-type="Boolean" /></td>
<td><input style="width:140px;" type="text" id="id" ng-model="item.id" readonly /></td>
<td><input style="width:305px;" type="text" id="organizationNameEN" ng-model="item.organizationName" readonly/></td>
<td><input style="width:305px;" type="text" id="organizationNameEN" ng-model="item.organizationNameEN" readonly/></td>
<td><button type="button" class="btn btn-primary" style="height:25px">details</button></td>
</tr>
</tbody>