| 640 | } |
| 641 | |
| 642 | constructor() { |
| 643 | const role = inject(new HostAttributeToken('role'), {optional: true}); |
| 644 | |
| 645 | if (!role) { |
| 646 | this._elementRef.nativeElement.setAttribute('role', 'table'); |
| 647 | } |
| 648 | |
| 649 | this._isServer = !this._platform.isBrowser; |
| 650 | this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE'; |
| 651 | |
| 652 | // Set up the trackBy function so that it uses the `RenderRow` as its identity by default. If |
| 653 | // the user has provided a custom trackBy, return the result of that function as evaluated |
| 654 | // with the values of the `RenderRow`'s data and index. |
| 655 | this._dataDiffer = this._differs.find([]).create((_i: number, dataRow: RenderRow<T>) => { |
| 656 | return this.trackBy ? this.trackBy(dataRow.dataIndex, dataRow.data) : dataRow; |
| 657 | }); |
| 658 | } |
| 659 | |
| 660 | ngOnInit() { |
| 661 | this._setupStickyStyler(); |