angularjs在发布后将数据推送到ng-repeat对象

时间:2017-06-08 07:40:06

标签: javascript angularjs

以下是我的代码

<select class="form-control" id="prevCountry" name="prevCountry" ng-model="asset.assets.countryID" ng-options="value.ID as value.country for value in technical.country">
  <option value="">Select Country</option>
</select>

angularjs代码

$ scope.technical.assets.push($ scope.assets);

我发布了countryID,但我想将country-country的countryName推入ng-repeat对象。

1 个答案:

答案 0 :(得分:1)

如果我理解正确,您需要查看ngOptions用法here的示例。为您创建了Plunker。希望它会有所帮助。

<select name="mySelect" id="mySelect"
  ng-options="option.countryName for option in technical.country"
  ng-model="asset.assets"></select>