我们可以在angularjs中使用ng-repeat在数组中显示重复项吗?

时间:2017-03-14 02:14:51

标签: angularjs

我有一个包含重复项目的数组。我想通过ng-repeat遍历我的数组中的所有项目。但是我无法显示重复的项目,这些项目在我的数组中是重复的值。我可以显示重复的项目用ng-repeat?

1 个答案:

答案 0 :(得分:3)

您可以在 for i := len(slice) - 1; i > 0; i-- { j := rand.Intn(i + 1) slice[i], slice[j] = slice[j], slice[i] }

之后使用track by $index
ng-repeat

如果您向OP添加代码,我将能够提供更多优势。