I have a get request which displays an array of objects in the view via *ngFor loop. I can't seem to figure out how to get the desired result below. This is a really basic example to give you an idea of what I am trying to achieve.
data = [
{
"name": "Bill",
"job" : "Builder"
},
{
"name": "John",
"job": "Cook"
},
{
"name": "Bill",
"job" : "Builder"
}
]
Then when the *ngFor loop is created, I'd like to be able to show something like this:
Bill [2]
John [1]
any suggestions would be greatly appreciated.