I'm working on a project in which I would like to populate a selectbox with all the cities of a certain country. The array I get from my db is about 2800 records long. When Angular renders this selectbox it takes pretty long although the data is ready for rendering very fast.
Here is my html code:
<div class="form-group">
<label for="city">City</label>
<select type="text" id="city" class="form-control" ngModel name="city" required [ngModel]="user?.city.zipcode">
<option *ngFor="let city of cities" value="{{city.zipcode}}">{{city.cityName}}</option>
</select>
</div>
I tried to get it to speed up using virtual scrolling but I'm not finding very good examples in how to use this with selectboxes and this also doesn't fix the rendering lag caused by the 2-way binding. Does anyone have a solution for this which I can follow. I'm still a junior in Angular so any help is more than welcome.
Thanks for you're time and effort in advance!