Here is the HTML representation of my data:
https://i.sstatic.net/VbKQ4.png
page.html
<ul id="elements">
<li *ngFor="let elem of fetchdata" (click)="log(elem)">
{{elem.title}} {{elem.description}}
</li>
</ul>
page.ts
This is where I retrieve data from local storage.
My goal is to update the title
element of the clicked object in the array when I click on it,
//ARRAY STRUCTURE JUST FOR YOUR NEED
//[{title:"saurabh" , description:"dd" , tagline:"tt", date:"dd"}];
this.fetchdata = JSON.parse(localStorage.getItem('education'));
log(elem,index) {
console.log(elem);
console.log(index);
//WHEN I CLICK, I WANT THE TITLE TO BE UPDATED TO "CLICKED", REST ALL PROPERTIES TO REMAIN SAME
//ARRAY STRUCTURE JUST FOR YOUR NEED
//[{title:"saurabh" , description:"dd" , tagline:"tt", date:"dd"}];
localStorage.setItem("education",JSON.stringify(this.fetchdata));
}