1
Guys, I need some help:
I’m trying to set the first state in the combo, I’ve put Selected but without success. Can someone tell me what might be wrong, or something to help me solve.
My code:
<div class="col s6">
<label>Escolha seu estado</label>
<select [(ngModel)]="municipio.estado" (change)="buscarCidadesPorEstado($event.target.value)" name="estado" class="browser-default">
<option selected [value]="e.estado" *ngFor="let e of estados" >{{e.estado}}</option>
</select>
</div>
I await suggestions for solutions. Thank you!!
The way your code is, all "options" are tagged "Selected" - which is not desirable, you can remove "Selected" and set the initial value directly in "municipio.estado" (in typescript).
– Duilio Benjoino
What is the angular version?
– Wallace Maxters
Wallacemaxters is 5 the version I’m working on
– Gabriela Mendonça