Below I am creating an array of characteristics, when they are defined and confirmed the icon changes to green. But when editing this input field as the second photo shows, the icon should change to blue, but the icon of the first field is also changing and I don't want that. I want the icon to change only in the field that the user wants to change, could someone help me please?
HTML
<div class="characteristics" *ngIf="asset">
<h1>{{ 'manageAssets.crud.characteristic' | translate }}</h1>
<p>{{ mode !== 'create' && asset.characteristics.length > 0 ? ('manageAssets.crud.charTipEdit' | translate) : mode === 'create' || asset.characteristics.length > 0 ? ('manageAssets.crud.charTipCreate' | translate) : ('manageAssets.crud.noChar' | translate)}}</p>
<div class="inline-vertical-align" *ngFor="let char of asset.characteristics; index as i">
<div class="input-container">
<label class="input-label" *ngIf="i === 0">{{ 'manageAssets.crud.charName' | translate }}</label>
<input [disabled]="mode === 'view' || mode === 'edit'" class="input etc" (input)="input()" [(ngModel)]="char.key" [placeholder]="'manageAssets.crud.insertHere' | translate">
</div>
<div class="input-container">
<label class="input-label" *ngIf="i === 0">{{ 'manageAssets.crud.charValue' | translate }}</label>
<input [disabled]="mode === 'view' || mode === 'edit'" class="input etc" (input)="input()" [(ngModel)]="char.value" [placeholder]="'manageAssets.crud.insertHere' | translate">
</div>
<mat-icon class="input-data" *ngIf="mode === 'create'" (click)="updatedCharacteristics(char)" [ngClass]="confirmedCharacteristics ? 'confirmed' : char.key?.length === 0 || char.value?.length === 0 ? 'mat-icon' : 'toConfirmed'">{{ confirmedCharacteristics ? 'done_all' : 'done' }}</mat-icon>
<mat-icon class="input-data" *ngIf="mode === 'create'" (click)="removeSpecificChar(i)" [ngClass]="'clean'" [matTooltipClass]="'tooltip-primary'"
[matTooltip]="addCharacteristics ? ('tooltip.remove' | translate) : ('tooltip.clean' | translate)">{{ addCharacteristics ? 'delete' : 'close' }}</mat-icon>
</div>
TS
public input(): void {
this.confirmedCharacteristics = false;
console.log(this.confirmedCharacteristics)
}
public updatedCharacteristics(changedChar: ProductCharacteristics): void {
console.log(changedChar)
for (let i = 0; i < this.asset.characteristics.length; i++) {
if (this.asset.characteristics[i].key === changedChar.key || this.asset.characteristics[i].value === changedChar.value) {
this.asset.characteristics[i] = changedChar;
this.confirmedCharacteristics = true;
}
}
}

