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

Method toggleExpansion

src/aria/private/behaviors/tree/tree.ts:237–244  ·  view source on GitHub ↗

Toggles the expansion of the given item.

(item?: T)

Source from the content-addressed store, hash-verified

235
236 /** Toggles the expansion of the given item. */
237 toggleExpansion(item?: T) {
238 item ??= this.inputs.activeItem();
239 if (!item || !this.isFocusable(item)) return;
240
241 if (this.isExpandable(item)) {
242 this.expansionBehavior.toggle(item);
243 }
244 }
245
246 /** Expands the given item. */
247 expand(item: T) {

Callers 1

gotoMethod · 0.80

Calls 4

isFocusableMethod · 0.95
isExpandableMethod · 0.95
activeItemMethod · 0.80
toggleMethod · 0.65

Tested by

no test coverage detected