Issue
How to disable the save button when all checkboxes are unchecked, and if at least one hour selected in the schedule will be, the save button becomes active? Please help. My code: https://stackblitz.com/edit/angular-ivy-slrmqc?fbclid=IwAR3mZbHjz8TkLUZJI1kd7gsMnaPikdS0eyGzdF17RPYJ70jyHhXMOzW8x3w&file=src%2Fapp%2Fapp.component.ts
Solution
You can add checkIsAllUnchecked
method
checkIsAllUnchecked() {
this.isAllUnchecked = this.arr.every((row) =>
row.items.every((col) => col === 0)
);
}
and call it in ngOnInit
, click
and toggleRow
methods
and add the check to the Save button
<button [disabled]="isAllUnchecked" (click)="save()">Save</button>
Answered By - Narek Ghazaryan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.