title: sum of column values from json object and show it in column in angular 2
body: <p>I have a JSON data and in that JSON data, I am getting the exact information and showing in my UI screen, after that I am totaling the data using nested <code>foreach</code> loop, I am able to see the data, and after I want to total the column of the particular id, and show it on UI screen, for that, I am using filter method to separate the id and I am getting the id, but I need to total the value of the id and show it on screen. </p>
  
  <p>How can I do in angular 2</p>
  
  <pre><code> var groups = new Set(this.payments.map(item =&gt; item.group))
        this.columnData=[];
        groups.forEach(g =&gt; {
          this.columnData.push({
            workerID : g ,
            totalsalary: g,
          values: this.payments.filter(i =&gt; i.group === g)
  
          })
    })  
  </code></pre>