Skip to content Skip to sidebar Skip to footer

Button With Ng-disabled Always Enabled

I'm trying to conditionally enable/disable my Save button using ng-disabled:

The double curly brackets convert the Angular expression to a string. In JavaScript, the string "false" is truthy. Hence both strings "true" and "false" evaluate as truthy and the button is always enabled.

Directives which expect boolean values won't work.

See Why mixing interpolation and expressions is bad practice.

Post a Comment for "Button With Ng-disabled Always Enabled"