2
Before in Angular 1 when I wanted to make a grouping of data I did so:
ng-repeat="(key, value) in me | groupBy: 'role_id'"
In my object me
had a list of users with a field role_id
different. Then I wanted to do so:
# Admin
Diego
João
Maria
# User
Márcio
Alex
Daniella
Only with this command line could I group. But I’m not able to do that in Angular 2 (Typescript), using Ionic.
Which command is similar to this to use at Angular 2?
I’m using the NgFor
, but I can’t do the grouping.
Related subject: https://stackoverflow.com/questions/37248580/how-to-group-data-in-angular-2 and https://stackoverflow.com/questions/35890413/angular2-typescript-nested-ngfor-without-nested-object
– novic
Until it helped. I understood a little about it. But it is giving error in a Foreach.
– Diego Souza