Ng网格删除重复项

时间:2015-01-22 11:48:51

标签: asp.net-mvc angularjs ng-grid

在我的Ng网格单元格中,我已应用此单元格模板。我正在获取数据,但有重复的regionName。

<select ng-cell-input
    ng-options="l.RegionID as l.RegionName for l in regionActivities"
    ng-class="'colt' + $index" ng-model="COL_FIELD" ng-input='COL_FIELD' ng-change="activityRegionChange(row)" ng-show='!isRoomRequestInProgress'></select>
{{COL_FIELD}}

有没有办法防止重复?

1 个答案:

答案 0 :(得分:0)

您需要做的是构建或重用unique filter

<select ng-cell-input
ng-options="l.RegionID as l.RegionName for l in regionActivities | unique:'RegionName'"
ng-class="'colt' + $index" ng-model="COL_FIELD" ng-input='COL_FIELD' ng-change="activityRegionChange(row)" ng-show='!isRoomRequestInProgress'></select>