angularjsangularjs-directive

How do I add multiple conditions to "ng-disabled"?


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?


Solution

  • You should be able to && the conditions:

    ng-disabled="condition1 && condition2"