Looking for a solution to remove duplicates from an array? You may have come across using track by $index in ng-repeat of angularjs, but you want to stick with a regular ng-repeat. Here's the scenario:
Array=[
{ name:'john',salary:'2000'},{ name:'john',salary:'2000'},{ name:'john',salary:'2000'},{ name:'harry',salary:'2000'}]
One approach you may have tried is adding a new field to the array like this:
for(x in Array){
Array[x].unique=x;
}
However, this method assigns the same value to all duplicate items. Wondering if there's a better way to handle this in the controller of angularjs?