2
I have a problem with angular expression
So it doesn’t work ! checked || ! checked2
<body ng-app="">
<label>
Click me to toggle:
<input type="checkbox" ng-model="checked">
<input type="checkbox" ng-model="checked2">
</label>
<br/>
<button ng-model="button" ng-disabled="!checked || !checked2">Button</button>
</body>
So it works checked || checked2
<body ng-app="">
<label>
Click me to toggle:
<input type="checkbox" ng-model="checked">
<input type="checkbox" ng-model="checked2">
</label>
<br/>
<button ng-model="button" ng-disabled="!checked || !checked2">Button</button>
</body>
need 2 checkboxs that as I select one of the two, certain field will be enabled, it would be a bug?
This question does not fit the regex tag
– Paz
When a checkbox is checked, it automatically becomes TRUE, the condition " ! checked || ! checked2 " will not work because it says: "Only works if one of the checkboxes is False (unchecked)"
– Jackson
I don’t understand where you are identifying possible Bug there, the conditions are correct. Ng-Disable only works if the condition inside it has TRUE output
– Jackson
I don’t know if it fits as a bug, but in this way it worked !(control || controle2) The idea here is that with checkbox marked the return would be true, denying that the return would be false, denying the ng-disabled of the field , remembering that I tested the expression ! control || ! control2 inside an ng-checked and worked, did not need to change to !(control || control2) , just inside ng-disabled that didn’t work.
– HUGO PABLO
I will answer below for you to understand better.
– Jackson