I'm facing an issue with understanding how to utilize *ngIf in a *ngFor loop.
Here's my code:
<div *ngFor="let movie of movieList" class="movieRow">
<button (click)="onEdit()">click</button>
<div *ngIf="isEditEnable">
<input />
</div>
And here's the TypeScript part:
isEditEnable: boolean = false;
onEdit() {
this.isEditEnable = !this.isEditEnable;
}
Upon running this, the boolean value changes globally for all movies in movieList, causing the input box to appear for all movies. I aim to display it only for the clicked movie.
Should I implement events for this? If so, how should I proceed?
Your guidance is much appreciated.