src/table/table-container.component.ts
AfterContentInit
selector | cds-table-container, ibm-table-container |
styles |
:host { display: block }
|
template |
|
Properties |
Methods |
HostBindings |
class.cds--data-table-container |
Type : boolean
|
Default value : true
|
Defined in src/table/table-container.component.ts:19
|
ngAfterContentInit |
ngAfterContentInit()
|
Defined in src/table/table-container.component.ts:25
|
Returns :
void
|
containerClass |
Default value : true
|
Decorators :
@HostBinding('class.cds--data-table-container')
|
Defined in src/table/table-container.component.ts:19
|
headerDescription |
Type : TableHeaderDescription
|
Decorators :
@ContentChild(TableHeaderDescription)
|
Defined in src/table/table-container.component.ts:22
|
headerTitle |
Type : TableHeaderTitle
|
Decorators :
@ContentChild(TableHeaderTitle)
|
Defined in src/table/table-container.component.ts:21
|
table |
Type : Table
|
Decorators :
@ContentChild(Table)
|
Defined in src/table/table-container.component.ts:23
|
import {
AfterContentInit,
Component,
ContentChild,
HostBinding
} from "@angular/core";
import { TableHeaderDescription } from "./header/table-header-description.directive";
import { TableHeaderTitle } from "./header/table-header-title.directive";
import { Table } from "./table.component";
@Component({
selector: "cds-table-container, ibm-table-container",
template: `<ng-content></ng-content>`,
styles: [`
:host { display: block }
`]
})
export class TableContainer implements AfterContentInit {
@HostBinding("class.cds--data-table-container") containerClass = true;
@ContentChild(TableHeaderTitle) headerTitle: TableHeaderTitle;
@ContentChild(TableHeaderDescription) headerDescription: TableHeaderDescription;
@ContentChild(Table) table: Table;
ngAfterContentInit() {
// Set aria properties if values exist otherwise keep undefined
if (this.table) {
this.table.ariaLabelledby = this.headerTitle?.id;
this.table.ariaDescribedby = this.headerDescription?.id;
}
}
}
:host { display: block }