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

Method toggle

src/cdk/tree/tree.ts:638–644  ·  view source on GitHub ↗

If the data node is currently expanded, collapse it. Otherwise, expand it.

(dataNode: T)

Source from the content-addressed store, hash-verified

636
637 /** If the data node is currently expanded, collapse it. Otherwise, expand it. */
638 toggle(dataNode: T): void {
639 if (this.treeControl) {
640 this.treeControl.toggle(dataNode);
641 } else if (this._expansionModel) {
642 this._expansionModel.toggle(this._getExpansionKey(dataNode));
643 }
644 }
645
646 /** Expand the data node. If it is already expanded, does nothing. */
647 expand(dataNode: T): void {

Callers

nothing calls this directly

Calls 2

_getExpansionKeyMethod · 0.95
toggleMethod · 0.65

Tested by

no test coverage detected