How to add the amount if they have same category in angular and remove the duplicate entry.
For example:
self.lineDetails = [{id:'0',category:'AAA',amount:'500'},
{id:'1',category:'BBB',amount:'200'},
{id:'2',category:'AAA',amount:'300'}]
Desired Output:
self.newLineDetails = [{id:'0',category:'AAA',amount:'800'},
{id:'1',category:'BBB',amount:'200'}]