title: Angular 4 Total sum
body: <p>I have this</p>
  
  <pre><code>    lists = [
      {
          name: 'Картошка',
          cost: 20,
          checked: false,
      },
      {
          name: 'Хлеб',
          cost: 10,
          checked: false,
      }
      ];
  
      cart = [];
  
      check(list: any){
          list.checked = !list.checked
          if(list.checked) {
              this.cart.push(list.cost);
          } else{
  
          }
          console.log(this.cart); 
      }
  </code></pre>
  
  <p>Please help. When click on checkbox(true), add cost to totalSum. And when checkbox(false) delete cost from totalSum. I dont know how made it. Please help. Thanks!
  How made it?</p>