Select all checkbox elements except disabled ones using Angular


Trying to Select all checkbox checking and need to restrict disabled checkboxes and check only enabled checkboxes, but all checkboxes are selecting(all enabled and disabled checkboxes are checking). Please suggest me,

checkuncheckall() {
    this.isChecked = !this.isChecked;
    this.displaying_results.forEach(i => {
      //(this.persons[i].checked && !this.persons[i].disabled) = this.isChecked;
     this.persons[i].checked = this.isChecked;

Sample Example

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.