I have this html code:
<tr>
<td><label>G Level 3</label></td>
<td><select [ngModel]="selectedG3" (ngModelChange)="selectG3Changed($event)">
<option></option>
<option *ngFor="let g3 of gLevels3" [ngValue]="g3">{{g3.name}}</option>
</select>
</td>
</tr>
This is my ts-code:
gLevels3: GLevel[];
getGLevels3(): void {
this.httpServerService.getGLevels(3).subscribe(glevel3 => this.gLevels3 = glevel3);
}
gLevels3 is an Array with Objects. I want to update the options of select every time I call the function getGLevels3().
Currently it is not working. After calling the function there are still the same options inside the select.
How can I trigger the update?