Queestion: in a result of groupby:'id', are groups ordered by id?
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- angular, javascript
- Domain
- frontend
Research direction
Look at the groupBy filter implementation in the source code to see if it sorts groups by the grouping key. Check the test files for groupBy to understand expected behavior. Verify if the order is guaranteed by reading the documentation or comments. Then update the documentation to clarify ordering behavior.
Written by the indexing model from the issue text.
Description
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?
<div ng-repeat="list in elements | groupBy('group_id') | toArray:true | orderby('group_id')">
<div ng-repeat="elem in list | orderBy('b')">
{{elem.b}}
</div>
</div>
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 319
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from a8m/angular-filter
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a8m/angular-filter#267 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a8m/angular-filter#260 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a8m/angular-filter#254 · 2 comments · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a8m/angular-filter#250 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a8m/angular-filter#208 · 1 comment · 1 reaction ·
All issues in a8m/angular-filter
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
curation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#186 ·
-
light
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aemdemos/patients-stryker#253 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·