I have 2 selects filled with 2 object arrays in a modal:
<select class="browser-default" id="gebied"
[(ngModel)]="filteredGebied"
(ngModelChange)="onChange($event)">
<option *ngFor="let gebied of list1"
value="{{gebied.id}}">{{gebied.beschrijving}}</option>
</select>
<select class="browser-default" id="domein" [(ngModel)]="filteredDomein">
<option *ngFor="let domein of list2"
value="{{domein.id}}">{{domein.beschrijving}}</option>
</select>
Now I want to change the items from the second select (list2) based on the selected item from list1.
onChange(list1Id){
...
this.list2 = ...
}
Problem is my select options in the second select (list2) don't change.
Sometimes I get the following error:
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngForOf:
How can I fix this all?