src/table/table-container.component.ts
AfterContentInit
| selector | cds-table-container, ibm-table-container |
| template | |
Properties |
Methods |
Inputs |
HostBindings |
| aiEnabled | |
Type : boolean
|
|
Default value : false
|
|
|
Defined in src/table/table-container.component.ts:22
|
|
|
When true, the table container gets full-table AI presentation (Carbon |
|
| class.cds--data-table-container |
Type : boolean
|
Default value : true
|
|
Defined in src/table/table-container.component.ts:17
|
| ngAfterContentInit |
ngAfterContentInit()
|
|
Defined in src/table/table-container.component.ts:28
|
|
Returns :
void
|
| containerClass |
Default value : true
|
Decorators :
@HostBinding('class.cds--data-table-container')
|
|
Defined in src/table/table-container.component.ts:17
|
| headerDescription |
Type : TableHeaderDescription
|
Decorators :
@ContentChild(TableHeaderDescription)
|
|
Defined in src/table/table-container.component.ts:25
|
| headerTitle |
Type : TableHeaderTitle
|
Decorators :
@ContentChild(TableHeaderTitle)
|
|
Defined in src/table/table-container.component.ts:24
|
| table |
Type : Table
|
Decorators :
@ContentChild(Table)
|
|
Defined in src/table/table-container.component.ts:26
|
import {
AfterContentInit,
Component,
ContentChild,
HostBinding,
Input
} 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>`
})
export class TableContainer implements AfterContentInit {
@HostBinding("class.cds--data-table-container") containerClass = true;
/**
* When true, the table container gets full-table AI presentation (Carbon `cds--data-table-container--ai-enabled`).
*/
@Input() @HostBinding("class.cds--data-table-container--ai-enabled") aiEnabled = false;
@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;
}
}
}