I setting up a form in html to allow users to edit individual profiles if the check box is checks. So far, I'm using a ngFor loop to populate the page with data. The issue is that if I press the checkbox, every item in the returned data becomes editable.
The html looks like this:
<ul class="profiles">
<li *ngFor="let profile of profiles">
<ngb-panel title="Profile ID: {{profile.id}}">
<ng-template ngbPanelContent>
<label>Check here to edit:
<input type="checkbox" [(ngModel)]="checked">
<form>
<fieldset [disabled]="!checked">
<input
type="text"
[(ngModel)]="profile.profileName"
name="profileName"
>
</fieldset>
</form>
</ng-template>
</ngb-panel>
</li>
</ul>
Technically speaking, this does work; once the checkbox is checked, the input below is enabled. The issue here is that, because I'm using an ngFor loop to populate the html with the profile information, checking one checkbox enables ALL the profile sections. What I need to do is set this up so that each profile section will only be enabled if its individual edit checkbox is checked off. Are there any good ways to set this up, while still allowing the for loop?