I need to check that two conditions are both true before enabling a button:
Here is an example:
<button type="submit" ng-disabled="frmUser.pw2.$error.pwMatch" class="btn btn-primary" ng-click="ChangePassword()">Change</button>
This example only contains one condition within ng-disabled
. How would I add another such as a scope variable?
Or you can use ng-disabled="condition1 || condition2" , is depend of you logic conditional.
The ng-disabled Directive in AngularJS is used to enable or disable the HTML elements. If the expression inside the ng-disabled attribute returns true then the form field will be disabled or vice versa. It is usually applied on the form field (i.e, input, select, button, etc).
You should be able to &&
the conditions:
ng-disabled="condition1 && condition2"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With