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

Method expandAll

src/cdk/tree/control/nested-tree-control.ts:49–56  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

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[] {

Callers

nothing calls this directly

Calls 3

getDescendantsMethod · 0.95
clearMethod · 0.65
selectMethod · 0.65

Tested by

no test coverage detected