title: Unable to remove items using splice within for loop in Angular
body: <p>I am trying to remove an item from an existing array using splice but is not working as expected. I even tried using filter instead of splice but got the same output. Can some one please take a look at the functionality here and help me figure out the issue.</p>
  
  <p>Please try to add the available items here - <a href="https://08b11a0437.stackblitz.io/products" rel="nofollow noreferrer">https://08b11a0437.stackblitz.io/products</a> then navigate to the cart page and try to remove each item. The items are not getting removed as expected.</p>
  
  <p>Relevant Code is available in cartservice.ts, cartcomponent.ts(removeProductFromCart()) and cartcomponent.html - <a href="https://stackblitz.com/edit/08b11a0437?file=app%2Fcart%2Fcart.component.ts" rel="nofollow noreferrer">https://stackblitz.com/edit/08b11a0437?file=app%2Fcart%2Fcart.component.ts</a></p>