How do I add multiple conditions to “ng-disabled”?

2020-05-24 19:12发布

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?

7条回答
家丑人穷心不美
2楼-- · 2020-05-24 20:12

Wanny is correct. The && operator doesn't work in HTML. With Angular, you must use the double pipes (||)for multiple conditions.

查看更多
登录 后发表回答