I'm having a really strange issue with Angular forms.
So basically, I have a form that includes a custom select with 3 options.
<div class="form-group">
<label class="form-label" for="custom-select">Type of Map:</label>
<select class="custom-select" ngModel #mapType="ngModel" name="mapType" required>
<option *ngFor="let m of mapTypes" value="{{m.value}}">{{m.name}}</option>
</select>
</div>
Now, in theory this should load the data from this array:
mapTypes = [{value:1, name:'Draw All'}, {value:2, name: 'Draw Movements (Display Most Recent)'}, {value:3, name: 'Draw Movements (Display All)'}];
And it successfully does. The only problem is on page load it looks like this:
But, when I click on it I get all of the options (and the values do successfully pass when the form is submitted)
So, my question is, why is this happening and how can I fix it? The options are loading in correctly and the first option is selected as default (which is what I want). Yet it won't show written into the box when the page is loaded. It's weird because I have another dropdown that works just like this (actually more extensive) and it works perfectly fine.