Ajay Paul
Ajay Paul

Reputation: 1

ng-disabled with multiple conditions

I am writing a condition in an AEM/CQ in jsp where:

ng-disabled="${!properties.enableSignInButton} || ${!(!loginForm.logInCOFInput.$invalid)} || ${(captchaShow && !captchaValidated)}"

which doesn't seems to be working.

When I print this in jsp, I get: |||| in the page where '||' is printed literally without resolving it. Seems that is what is happening inside the ng-disabled.

Upvotes: 0

Views: 4476

Answers (2)

Vasanth
Vasanth

Reputation: 451

two conditon must true means use "&&"

ng-disabled = "condition1 && condition2"

Any one condition true means use "||"

ng-disabled = "condition1 || condition2"

Upvotes: 1

SantiG
SantiG

Reputation: 828

ng-disabled receives an expression there is no need to use

ng-disabled="!properties.enableSignInButton || !(!loginForm.logInCOFInput.$invalid) || (captchaShow && !captchaValidated)"

Upvotes: 0

Related Questions