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

Method ngOnInit

src/cdk/table/text-column.ts:118–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116 }
117
118 ngOnInit() {
119 this._syncColumnDefName();
120
121 if (this.headerText === undefined) {
122 this.headerText = this._createDefaultHeaderText();
123 }
124
125 if (!this.dataAccessor) {
126 this.dataAccessor =
127 this._options.defaultDataAccessor || ((data: T, name: string) => (data as any)[name]);
128 }
129
130 if (this._table) {
131 // Provide the cell and headerCell directly to the table with the static `ViewChild` query,
132 // since the columnDef will not pick up its content by the time the table finishes checking
133 // its content and initializing the rows.
134 this.columnDef.cell = this.cell;
135 this.columnDef.headerCell = this.headerCell;
136 this._table.addColumnDef(this.columnDef);
137 } else if (typeof ngDevMode === 'undefined' || ngDevMode) {
138 throw getTableTextColumnMissingParentTableError();
139 }
140 }
141
142 ngOnDestroy() {
143 if (this._table) {

Callers

nothing calls this directly

Calls 4

_syncColumnDefNameMethod · 0.95
addColumnDefMethod · 0.80

Tested by

no test coverage detected