0
私は私の角度のコードでは、このドロップダウンリストを持っている:どのように選択し得るために、NG-オプションのオプションテキスト
HTML:
<select class="selected_location" ng-options="perlocation.id as perlocation.name for perlocation in locations" ng-model="cleaningServiceLocation">
<option value="">Please Select Location</option>
</select>
<p>{{cleaningServiceLocation}}</p>
レンダリング:
<select class="selected_location" ng-options="perlocation.id as perlocation.name for perlocation in locations" ng-model="cleaningServiceLocation">
<option value="" class="" selected="selected">Please Select Location</option>
<option value="string:loc1" label="Location Name">Location Name</option>
<option value="string:loc2" label="Other Name">Other Name</option>
</select>
いつでもユーザー選択オプション私は "場所名"のようなオプションの内部テキストを取得する必要があります。
しかし、我々はperlocation.name
に
はい、perlocation.nameとperlocation.idとして値を表示します。 – CodeMan
つまり、 "ng-options =" perlocation.nameをperlocation.nameとして実行し、 " – Kroderia