This code snippet is a simplified version of what I'm trying to do but the concept is the same. I have a large number of fields defined inside a fieldset and I have set them all to be disabled at the fieldset level. There are conditions when I want one or two of the fields to be enabled. I know I can do this by putting an ng-disabled on every input, but in my real app there are about 100 inputs.
<fieldset ng-disabled=true>
<input type="text" ng-disabled=false>
<input type="radio" >
<select >
<option>Female</option>
<option>Male</option>
</select>
</fieldset>
In the case above, the text field where I set ng-disabled=false is ignored. Because it's inside the fieldset, the ng-disabled at the fieldset level takes precedence. Does anyone know how to get around this other than by setting every field individually and not at the fieldset level?
question from:
https://stackoverflow.com/questions/66066151/is-it-possible-in-angular-to-overried-ng-disabled-within-a-fieldset 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…