a8m / a8m/angular-filter

Queestion: in a result of groupby:'id', are groups ordered by id?

Đang mở
#144 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
2.9k
Fork
319
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

In relation to https://github.com/a8m/angular-filter/issues/140 and https://github.com/a8m/angular-filter/issues/136 i'm wondering if in a result of groupby:'id', are groups specifically ordered by the grouping key ('id').

let me clarify my question with an example:

```
var elements = [
{group_id: 1, b:10},
{group_id: 2, b:9},
{group_id: 3, b:8},
{group_id: 1, b:7},
{group_id: 2, b:6},
{group_id: 3, b:5},
{group_id: 1, b:4},
{group_id: 2, b:3},
{group_id: 3, b:2},
{group_id: 1, b:1},
{group_id: 2, b:0},
]

var lists = $filter('groupBy')(elements, 'group_id');
var elements = $filter('orderBy')(elements, 'b');

angular.forEach(lists, function(list) {
angular.forEach(list, function(element) {
console.log(element.b);
});
});
```

will this example provides always [1 4 7 10] [0 3 6 9] [2 5 8] with groups ordered by group_id as above or i should need an additional orderby?

in other terms is the orderby in the first ng-repeat of the following example redundant?

```



{{elem.b}}


```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.