I think it would be useful to be able to group on nested fields, as can be done with orderBy, such as
<div ng-repeat="placePeople in people | groupBy:'homeAddress.town':'peopleByHome'">
<h2>{{placePeople['homeAddress.town']}}</h2>
These changes make use of $parse to achieve this.
Note it is a backwards incompatible change in terms of grouping by functions, as now you can't leave off the braces in the expression, i.e.
<div ng-repeat="placePeople in people | groupBy:'uptown()':'peopleByHome'">
<h2>{{placePeople['uptown()']}}</h2>
So probably would need a version bump.
Given these changes, I'd be tempted to make a further change (which is not included here) to use a fixed name for the group key, rather than the expression, as the above would probably look neater with
<h2>{{placePeople.groupKey}}</h2>
Hope this is useful. Let me know any thoughts, thanks.
I think it would be useful to be able to group on nested fields, as can be done with
orderBy
, such asThese changes make use of
$parse
to achieve this.Note it is a backwards incompatible change in terms of grouping by functions, as now you can't leave off the braces in the expression, i.e.
So probably would need a version bump.
Given these changes, I'd be tempted to make a further change (which is not included here) to use a fixed name for the group key, rather than the expression, as the above would probably look neater with
Hope this is useful. Let me know any thoughts, thanks.