Apparently, the problem is caused by the fact that Angular was not able to properly track the elements of my array. I found it very hard. So just adding the trackBy attribute to my ngFor, I was able to solve this problem.
Added this to my component:
customTrackBy(index: number, obj: any): any { return index; }
and then in the template:
<div class="margin-bottom-15" *ngFor="let assessment of language.assessments; trackBy:customTrackBy">
So basically I ask Angular to keep track of my elements in the array by index. He solved the problem.
Here assessment is a model for each set of questions.
Pratik barasia
source share