Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
236 views
in Technique[技术] by (71.8m points)

Is it possible in Angular to overried ng-disabled within a fieldset

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...