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

Method _createDefaultHeaderText

src/cdk/table/text-column.ts:152–164  ·  view source on GitHub ↗

* Creates a default header text. Use the options' header text transformation function if one * has been provided. Otherwise simply capitalize the column name.

()

Source from the content-addressed store, hash-verified

150 * has been provided. Otherwise simply capitalize the column name.
151 */
152 _createDefaultHeaderText() {
153 const name = this.name;
154
155 if (!name && (typeof ngDevMode === 'undefined' || ngDevMode)) {
156 throw getTableTextColumnMissingNameError();
157 }
158
159 if (this._options && this._options.defaultHeaderTextTransform) {
160 return this._options.defaultHeaderTextTransform(name);
161 }
162
163 return name[0].toUpperCase() + name.slice(1);
164 }
165
166 /** Synchronizes the column definition name with the text column name. */
167 private _syncColumnDefName() {

Callers 1

ngOnInitMethod · 0.95

Calls 1

Tested by

no test coverage detected