MCPcopy Create free account
hub / github.com/angular/components / constructor

Method constructor

src/cdk/table/table.ts:648–664  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

trackByMethod · 0.95
createMethod · 0.45

Tested by

no test coverage detected