我有一个空数组使用$ http.get(..)我得到10 JSON对象称为$scope.mobData=[];
如何访问来自多个对象中的字段,其是存在于阵列
并被推到阵列成功和每个对象有7个数据,但我只需要两个字段在每个对象中称为brandCode和brandName,它可以在所有10个对象中使用。但在我的UI部分我不能够显示我的品牌名称和品牌代码数据,这是我的html代码
<table >
<thead>
<th>BrandCode</th>
<th>BrandName</th>
<th>Action</th>
</thead>
<tbody>
<tr ng-repeat="mobData in mobDatas">
<td>{{mobData[index].brandCode}}</td>
<td>{{mobData[index].brandName}}</td>
<td>
<button type="button" class="button button-positive" ng-click="editMobData(mobData)">Edit</button>
<button type="button" class="button button-assertive" ng-click="deleteMobData(mobData)">Delete</button>
</td>
</tr>
</tbody>
</table>
当我使用{{mobData[o].brandCode}}
我能够查看数据,但没有使用暴徒[0]我无法查看我的数据。并且我也试过这个{{mobData.brandCode}}
我无法查看我的数据
你能提供你的json对象代码 – Rahul
在表达式中不需要'[index]'。 – Mahmoud
s没有使用它我怎么告诉用户界面从哪个对象它应该打印brandCode有10个对象从哪个对象它将打印mobData.brandCode –