Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
302 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...