MCPcopy Index your code
hub / github.com/angular/components / toggleDescendants

Method toggleDescendants

src/cdk/tree/tree.ts:668–678  ·  view source on GitHub ↗

* If the data node is currently expanded, collapse it and all its descendants. * Otherwise, expand it and all its descendants.

(dataNode: T)

Source from the content-addressed store, hash-verified

666 * Otherwise, expand it and all its descendants.
667 */
668 toggleDescendants(dataNode: T): void {
669 if (this.treeControl) {
670 this.treeControl.toggleDescendants(dataNode);
671 } else if (this._expansionModel) {
672 if (this.isExpanded(dataNode)) {
673 this.collapseDescendants(dataNode);
674 } else {
675 this.expandDescendants(dataNode);
676 }
677 }
678 }
679
680 /**
681 * Expand the data node and all its descendants. If they are already expanded, does nothing.

Callers

nothing calls this directly

Calls 4

isExpandedMethod · 0.95
collapseDescendantsMethod · 0.95
expandDescendantsMethod · 0.95
toggleDescendantsMethod · 0.65

Tested by

no test coverage detected