Reputation: 12025
I tried this function:
public hireDisableForm() {
const dis = this.person.birthDate == '' || this.person.passportNumber == '' || this.person.passportSerie == '';
return (!dis) ? null : dis;
}
It return me true
, I checked this in console.log()
.
Using:
<button class="hire1" [disabled]="hireDisableForm()">Save</button>
It does not disable button.
Upvotes: 1
Views: 119
Reputation: 13356
You do it in so complicated way! You can do it simpler:
public hireDisableForm() {
return !(this.person.birthDate &&
this.person.passportNumber &&
this.person.passportSerie);
}
Upvotes: 1