* Expand the data node and all its descendants. If they are already expanded, does nothing.
(dataNode: T)
| 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 { |
no test coverage detected