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

Function getColumnName

src/material/table/testing/cell-harness.ts:23–40  ·  view source on GitHub ↗

Gets the name of the column that the cell belongs to.

()

Source from the content-addressed store, hash-verified

21
22 /** Gets the name of the column that the cell belongs to. */
23 async getColumnName(): Promise<string> {
24 const host = await this.host();
25 const classAttribute = await host.getAttribute('class');
26
27 if (classAttribute) {
28 const prefix = 'mat-column-';
29 const name = classAttribute
30 .split(' ')
31 .map(c => c.trim())
32 .find(c => c.startsWith(prefix));
33
34 if (name) {
35 return name.split(prefix)[1];
36 }
37 }
38
39 throw Error('Could not determine column name of cell.');
40 }
41
42 protected static _getCellPredicate<T extends MatCellHarness>(
43 type: ComponentHarnessConstructor<T>,

Callers

nothing calls this directly

Calls 1

getAttributeMethod · 0.65

Tested by

no test coverage detected