Skip to content

Commit 2f35469

Browse files
CatscratchRonny Fritzsche
andauthored
fix: make MatMultiSortTableSettingsComponent generic for improved type safety (#229)
Co-authored-by: Ronny Fritzsche <[email protected]>
1 parent 206e630 commit 2f35469

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/mat-multi-sort-table-settings/mat-multi-sort-table-settings.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ import {FormsModule} from '@angular/forms';
1717
styleUrls: ['./mat-multi-sort-table-settings.component.scss'],
1818
imports: [MatCheckboxModule, CdkDropList, NgTemplateOutlet, MatTooltip, MatIcon, NgForOf, CdkDrag, NgIf, CdkDragHandle, FormsModule, MatChipSet, MatChipRow]
1919
})
20-
export class MatMultiSortTableSettingsComponent implements OnInit {
21-
_tableData!: TableData<unknown>;
20+
export class MatMultiSortTableSettingsComponent<T> implements OnInit {
21+
_tableData!: TableData<T>;
2222
sort: { id: string, name: string, direction: string }[] = [];
2323
overlayRef!: OverlayRef;
2424

2525
@ViewChild('templateRef', { static: true }) private templateRef!: TemplateRef<HTMLElement>;
2626

2727
@ViewChild('settingsMenu') buttonRef!: ElementRef;
2828

29-
@ContentChild('sortIndicator', { static: false }) sortIndicatorRef!: TemplateRef<unknown>;
29+
@ContentChild('sortIndicator', { static: false }) sortIndicatorRef!: TemplateRef<T>;
3030

3131
@Input()
3232
sortToolTip: string = '';
@@ -38,7 +38,7 @@ export class MatMultiSortTableSettingsComponent implements OnInit {
3838
scrollStrategy: ScrollStrategy = new BlockScrollStrategy(this.viewportRuler, document);
3939

4040
@Input()
41-
set tableData(tableData: TableData<unknown>) {
41+
set tableData(tableData: TableData<T>) {
4242
this._tableData = tableData;
4343
}
4444

0 commit comments

Comments
 (0)