I am attempting to populate several rows in a table I created. The table successfully populates, however I get an error:
"ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '1'. Current value: 'ah'."
This isn't really a problem because the error doesn't crash my program or anything, however whenever I change any of the units in my table, it changes the values of ALL the units to be whatever the "Current value" is in the error above. (in this case, I made it 'ah,' see code below)
This is how I'm populating the table:
<div class="row-container">
<div *ngFor="let week of getWeeks()" class="row">
<input class="week" maxlength="2" (input)="type($event.target.value, week)" value="{{getCapacity(week)}}">
</div>
</div>
And this is how I'm updating the value:
getCapacity(week: Date): string {
if (<conditions are met>) {
const capacity = EntryComponent.capacity[EntryComponent.index];
EntryComponent.index++;
return capacity.value;
}
return 'ah';
}
I'm not using a dynamic component as a tag, but rather dynamically changing the value of my input tag.