我正在表格中打印产品列表。此产品列表具有产品类型 ( typeId)。我希望能够typeId通过使用选择输入直接在表中更改产品的 。当我尝试在选择输入中设置产品的默认选项时,问题就出现了,因为它应该是带有typeId.ng-repeat="x in screensList". x 代表产品。我尝试使用 ng-init 或 ng-value,但它不起作用。每个选择的 ng-model 应该是什么值?代码和图片:<tbody> <tr ng-repeat="x in screensList"> <th scope="row"> {{x.pantalla}} </th> <td> {{x.description}} </td> <td> <select class="form-control" ng-model="slideshowSelect" ng-options="y.title for y in slideshowsList track by y.id"> </select> </td> <td class="text-right"> <button type="button" ng-click="deleteService($event)" serviceId="{{x.id}}" class="btn btn-danger btn-sm">Eliminar</button> </td> </tr></tbody>彩色代码:结果:
1 回答

MMTTMM
TA贡献1869条经验 获得超4个赞
我认为这就是你需要的:
<select class="form-control" ng-model="x.idSlideshow" ng-options="y.id as y.title for y in slideshowsList">
</select>
添加回答
举报
0/150
提交
取消