5

次のように、データをリストに表示しようとしています。

<option value="4351">Atlanta</option>

これが私のオブジェクトです。

$scope.cityList = {
    4351:{name:"Atlanta", short="atlanta"},
    7355:{name:"Baltimore", short="baltimore"},
    1212:{name:"Chicago", short="chicago"},
    4398:{name:"Dallas", short="dallas"}
};

HTML
これはキーと値のペアだけで機能しましたが、「値」はオブジェクトです

<select class="select-city" ng-model="myCity" ng-options="name for (city, name) in cityList"></select>

だから私の質問はこれです:
この場合、どうすれば ng-options を入力できますか?

4

1 に答える 1