I am working with reactive forms:
This is my form in html file:
<select class="form-group form-control" formControlName="Control{{prop.id}}" id="Control {{prop.id}}" name="Control{{prop.id}}" [required]="prop.mandatory" (change)="changeDropdown ($ event, prop.id)">
<option value=""> Select </option>
<option *ngFor="let data of dataMap.get (prop.id)" value="{{data.value}}">{{data.text}} </option>
</select>
From the ts file I want to select the option I need, when I do this it works perfectly:
this.formLoad.controls ['Control' + id] .setValue (1);
Now I want to select the option with the value = "" (value name: Select):
this.formLoad.controls ['Control' + id] .setValue ("");
This is not working for me, what could be the problem?
Thank you,