0

I am trying to set an inputs disabled attribute to true if a property has a value, however what I am using now seems to be returning true if the property is null or an empty string.

[attr.disabled]="userForm.value.email? true: false"
Sandra Willford
  • 3,459
  • 11
  • 49
  • 96

1 Answers1

1

To get an bound attribute removed, the value needs to be null instead of false

[attr.disabled]="userForm.value.email? true: null"
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567