* Expands all dataNodes in the tree. * * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level * data nodes of the tree.
()
| 47 | * data nodes of the tree. |
| 48 | */ |
| 49 | expandAll(): void { |
| 50 | this.expansionModel.clear(); |
| 51 | const allNodes = this.dataNodes.reduce( |
| 52 | (accumulator: T[], dataNode) => [...accumulator, ...this.getDescendants(dataNode), dataNode], |
| 53 | [], |
| 54 | ); |
| 55 | this.expansionModel.select(...allNodes.map(node => this._trackByValue(node))); |
| 56 | } |
| 57 | |
| 58 | /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */ |
| 59 | getDescendants(dataNode: T): T[] { |
nothing calls this directly
no test coverage detected