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

Method expandDescendants

src/cdk/tree/tree.ts:683–695  ·  view source on GitHub ↗

* Expand the data node and all its descendants. If they are already expanded, does nothing.

(dataNode: T)

Source from the content-addressed store, hash-verified

681 * Expand the data node and all its descendants. If they are already expanded, does nothing.
682 */
683 expandDescendants(dataNode: T): void {
684 if (this.treeControl) {
685 this.treeControl.expandDescendants(dataNode);
686 } else if (this._expansionModel) {
687 const expansionModel = this._expansionModel;
688 expansionModel.select(this._getExpansionKey(dataNode));
689 this._getDescendants(dataNode)
690 .pipe(take(1), takeUntil(this._onDestroy))
691 .subscribe(children => {
692 expansionModel.select(...children.map(child => this._getExpansionKey(child)));
693 });
694 }
695 }
696
697 /** Collapse the data node and all its descendants. If it is already collapsed, does nothing. */
698 collapseDescendants(dataNode: T): void {

Callers 1

toggleDescendantsMethod · 0.95

Calls 4

_getExpansionKeyMethod · 0.95
_getDescendantsMethod · 0.95
expandDescendantsMethod · 0.65
selectMethod · 0.65

Tested by

no test coverage detected