Gets the name of the column that the cell belongs to.
()
| 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>, |
nothing calls this directly
no test coverage detected