Reputation: 19695
I would like to select default value ( 484 which is Mexico), but the first item get selected.
In the text, I print all value, and they are all OK (country.id === tournament.venue.country_id
condition is working)
Here is my code, I am not using reactive forms:
<select class="form-control select-lg" id="country_id" name="country_id" [(ngModel)]="tournament.venue.country_id">
<option *ngFor="let country of countries"
[selected]="country.id === tournament.venue.country_id"
[ngValue]="tournament.venue.country_id">
{{ country.name }} {{ country.id }} {{ country.id === tournament.venue.country_id }}
</option>
</select>
What am I doing wrong ?
Upvotes: 0
Views: 2264