title: Angular: How to avoid duplicate entries in localstorage
body: <p>When I click on the heart button the data from that row gets stored in local storage but I want the data stored in local storage to be unique because when I click on the same row twice duplicate entry gets created in local storage.</p>
  
  <p>I have attached a screenshot of local storage here you can see duplicate entries of a branch are stored in local storage.</p>
  
  <p>here is the link to my code 
  <a href="https://stackblitz.com/edit/angular-ofvnz3?file=src%2Fapp%2Fhome%2Fhome.component.html" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-ofvnz3?file=src%2Fapp%2Fhome%2Fhome.component.html</a></p>
  
  <p>but you can't run this because of some import error. please solve it if possible.</p>
  
  <p><a href="https://i.stack.imgur.com/0oPZB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0oPZB.jpg" alt=""></a></p>