Skip to content

Instantly share code, notes, and snippets.

@StickNitro
Created November 1, 2018 11:59
Show Gist options
  • Save StickNitro/88379c4cd33dd3f766c3c9f4528cfc37 to your computer and use it in GitHub Desktop.
Save StickNitro/88379c4cd33dd3f766c3c9f4528cfc37 to your computer and use it in GitHub Desktop.
mat-table-multi-select-column
<ng-container matColumnDef="select">
<mat-header-cell *matHeaderCellDef>
<mat-checkbox (change)="$event ? masterToggle() : null" [checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()"></mat-checkbox>
</mat-header-cell>
<mat-cell *matCellDef="let row">
<mat-checkbox [checked]="selection.isSelected(row)" (click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"></mat-checkbox>
</mat-cell>
</ng-container>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment