请原谅术语,但是您可以将ng-options值链接在一起吗?
这就是我所拥有的:
<select class="form-control" id="field_cusPro"
name="cusPro" ng-model="rentalAgreement.customerProfile"
ng-options="cusPro as cusPro.Name for cusPro in cuspros track by cusPro.id">
<option value=""></option>
</select>
是否有ng-options="cusPro as cusPro.Name
和 cusPro.id
for cusPro in cuspros track by cusPro.id
。
这样的选择就像这样:
Name1 ID1, Name2 ID2 etc...
而不仅仅是
Name1, Name2, etc...
答案 0 :(得分:1)
是的,你可以这样做:
<select class="form-control" id="field_cusPro" name="cusPro" ng-model="rentalAgreement.customerProfile" ng-options="cusPro as cusPro.Name+' ('+cusPro.id+')' for cusPro in cuspros track by cusPro.id">
<option value=""></option>