选择不更新模型

时间:2015-08-20 13:55:28

标签: javascript angularjs html5

我在一个页面上有2个选择这样的元素:

  <div class="form-group">
   <label for="country">Land</label>
   <select id="country" required class="form-control" ng-model="localCountriesObjectNL" ng-options="item as item.getName() for item in countries"></select>
 </div>

  <div class="form-group">
   <label for="country">Country</label>
   <select id="country" required class="form-control" ng-model="localCountriesObjectEN" ng-options="item as item.getName() for item in engCountries"></select>
 </div>

在我的代码中我有两个范围变量,如:

$scope.localCountriesObjectNL;
$scope.localCountriesObjectEN;

当我使用NL对象更改de select中的语言时,它可以正常模型更新。第二个不更新模型。即使我点击选择列表中的其他项目,它也始终保持不变。

有人有想法吗?

编辑:

我刚注意到现在第一次没有更新。所以当我在页面上添加第二个html选择时会出现问题。

0 个答案:

没有答案