My problem is when i put a variable in the value attribute of my <option> the selected attibute do not work longer and nothing is showed by default in my combobox
<select class="form-control" id="status" formControlName="status">
<option value="" selected>-- Placeholder --</option>
<option value="{{variable1}}">Text 1</option>
<option value="{{variable2}}">Text 2</option>
<option value="{{variable3}}">Text 3</option>
</select>
In the las three <options> if value="" all works but when i put a variable or something else inside nothing is default showed i already tried with [selected]="true", with selected="false" on these three <option>. I know we can't use ngModel with it but i haven't this attribute
Anyone know how to solve this and preselect the first <option> on my combobox ?
form, you can preselect in Typescript like thisthis.form.get('status').setValue(this.variable1);or in the initializationthis.form = this.fb.group({ status: [this.variable1] });