你能把 link ng-options 的值放在一起吗?

Can you link ng-options values together?

请原谅这些术语,但是你可以 link 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.NamecusPro.idfor cusPro in cuspros track by cusPro.id

这样选项会是这样的:

       Name1 ID1, Name2 ID2  etc...

而不只是

       Name1, Name2, etc...

是的,你可以这样做:

<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>