I have an input with [disabled]depending on ngModelanother input. Initially it [disabled]works correctly, but not when we change the dependent input value, the property [disabled]does not work. How to apply two bindings to a property [disabled]?
Below is a snippet of code.
<select [ngModel]="isDisabled" (ngModelChange)="isDisabled=$event">
<option value="0">Disabled</option>
<option value="0">Enabled</option>
</select>
This model is isDisabledmodified correctly. I could see a change in value similar to this in the template {{isDisabled}}. But it does not appear in [disabled]the selection field property .
<select [ngModel]="userInput" [disabled]="isDisabled">
<option value="test">Test</option>
</select>
source
share