Hi Vikas,
The best way is to preprocess the array in your controller.
Assuming your array has the right sort order you can use a simple reducer.
I'll type you up an example in here, you might need to fiddle a bit around
to make it work for real:
$scope.result = $scope.items.reduce(function(res,item){
let i = res.findIndex(comp);
if (i === -1) {
res.push(item)
} else {
// write code here to combine the items as you like
}
return res
function comp(elm) {
return elm[0] === item[0] && elm[1] === item[1]
}
},[]);
Is thins enough for you to solve your issue?
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.