This is my .ts code
userCount(event_id){
this.http.get('http://localhost/getCount.php?event_id='+event_id)
.subscribe(res=>{
this.eventUserCount = res.json();
console.log("User NUM :: ", this.eventUserCount)
return this.eventUserCount
});
}
this is the HTML code from where there above function is being called:
<div *ngFor="let event of events">
....
<ion-col col-6 center text-center>
<button ion-button>
<div> {{ userCount(event.event_id) }} Users</div>
</button>
</ion-col>
...
</div>
I am getting infinite response from the server(as seen from console.log) I want to make separate http request for every list item and show the count for every event , instead of this infinite request and response loop. Can anyone help me with this??