我構建了一個下拉指令,它使用不同的對象類型,每個對象都有自己的特定屬性,我需要在我的下拉列表的ng-repat中獲得一些特定的字段,現在,它是固定的cityName,我怎樣才能改變cityName的變量,哪些留在控制器上?angular ng-repeat內動態屬性引用
<div class="listCombo" ng-show="showDrop" ng-mouseleave="lostFocus()">
<table>
<tr ng-repeat="result in results" ng-click="selectItem(result)">
<td> {{result.cityName}} </td>
</tr>
</table>
</div>
例如,我需要得到peopleName而不是的cityName。
我真的不明白你想要什麼,你想在'td'上設置cityName ore opepleName? –