ng-options显示重复的字符

时间:2015-06-17 09:03:17

标签: angularjs

我有一个字符串或字符列表,如下所示:

$list.Characters = []
var currGroup = String.fromCharCode(65 + $scope.lengthofsomething.length);
            $scope.Characters .push(currGroup);

当我在其他列表中添加内容时,我会动态创建一个列表(lengthofsomethinglist)。所以我得到了" A"," B"," C"例如。现在发生的是:

  <select ng-model="Characters " style="width:50px; color:black" ng-options="Characters[$index] for v in Characters" ng-change="somefucntion($index,v)"> </select>

并根据字符中有多少项生成此列表。如果我有A,B,C,那么我有3个这样的列表。

接下来每个列表都有自己的值但是这些值是这样的:

First List:
A
A
A
Second List:
B
B
B
Third List:
C
C
C 

如何让所有列表都有A,B,C而不重复相同?

当我在列表2中选择第3个B时,我得到值C,所以它只是一个显示错误,值是正常的。希望你得到我想要的东西..

0 个答案:

没有答案
相关问题