Hi,
I have property pages so when i click on a button it takes me to that specific property page and there i have a like button.
right now when i click the like button it is increased by one and when i go away and come back it is updated but the proplem i am facing is that the same variable is the same for all properties and that is wrong.
every property should have its own counter for the like button.
how to do that?
ngOnInit() {
let data2:any = localStorage.getItem('numLikes');
this.likes = JSON.parse(data2);
this.likes = Number(this.likes);
addLike(element:any){
this.likes += 1;
let data = element.textContent = this.likes;
localStorage.setItem('numLikes',JSON.stringify(data));
}