I'm a little confused by how I should go about this. I have a "feed" in my app, where each post in the feed has a comment box. Here's some sample code:
<ion-card class="feed" *ngFor="let post of feed">
<ion-item no-lines class="comment-input">
<ion-input type="text" placeholder="Write comment ..."></ion-input>
<button item-right ion-button (click)="feedPostComment(post)">Comment</button>
</ion-item>
</ion-card>
Now what I'm struggling to figure out is the best way to go about feedPostComment() to pull the text from the input field above it. I know I could use ngModel and I have in many cases for forms and input systems on pages where they aren't repeating in this way, but I just can't wrap my head around how I would do it in this case.
I was thinking that I could set post.id to be the id or name field on the ion-input, and target the input field directly through the DOM, but I realize that isn't good practice.
The other thing is, the feed itself will be regularly updating with new posts. Sincerest thanks in advance.