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

Method _getRowDefs

src/cdk/table/table.ts:1341–1362  ·  view source on GitHub ↗

* Get the matching row definitions that should be used for this row data. If there is only * one row definition, it is returned. Otherwise, find the row definitions that has a when * predicate that returns true with the data. If none return true, return the default row * definition.

(data: T, dataIndex: number)

Source from the content-addressed store, hash-verified

1339 * definition.
1340 */
1341 _getRowDefs(data: T, dataIndex: number): CdkRowDef<T>[] {
1342 if (this._rowDefs.length === 1) {
1343 return [this._rowDefs[0]];
1344 }
1345
1346 let rowDefs: CdkRowDef<T>[] = [];
1347 if (this.multiTemplateDataRows) {
1348 rowDefs = this._rowDefs.filter(def => !def.when || def.when(dataIndex, data));
1349 } else {
1350 let rowDef =
1351 this._rowDefs.find(def => def.when && def.when(dataIndex, data)) || this._defaultRowDef;
1352 if (rowDef) {
1353 rowDefs.push(rowDef);
1354 }
1355 }
1356
1357 if (!rowDefs.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1358 throw getTableMissingMatchingRowDefError(data);
1359 }
1360
1361 return rowDefs;
1362 }
1363
1364 private _getEmbeddedViewArgs(
1365 renderRow: RenderRow<T>,

Callers 1

_getRenderRowsForDataMethod · 0.95

Calls 3

pushMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected