Every time I try to send data to the ts file the ngModel resets the selection in the dropdown.
<select placeholder="select" class="custom-select" id="
{{entity.parameterDisplayName}}"
[(ngModel)]="entity.parameterValue"
name="{{entity.parameterDisplayName}}">
<option [value]="-1" [selected] ="true">Select Registration Type</option>
<option *ngFor="let regTypeValue of registrationTypeList"
[ngValue]="entity.parameterValue" [value]="regTypeValue"
[selected]="regTypeValue">{{ regTypeValue }} </option></select>
I have tried using [select] and onClick as well, However as the date is being transferred successfully, And the selection from the drop down is being reset every time I click on search button below. Which will send all the information from the data filled from the form.
As modifications can be done and be searched again. The selections on the form needs to stay Put. And all the data is static, But the dropdown resets itself, Please suggest me how to stop it from getting reset.
Please help
Thanks in Advance
Try one way binding of ngModel.