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

Method _initializeKeyManager

src/cdk/tree/tree.ts:459–480  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

457 }
458
459 private _initializeKeyManager() {
460 const items = combineLatest([this._keyManagerNodes, this._nodes]).pipe(
461 map(([keyManagerNodes, renderNodes]) =>
462 keyManagerNodes.reduce<CdkTreeNode<T, K>[]>((items, data) => {
463 const node = renderNodes.get(this._getExpansionKey(data));
464 if (node) {
465 items.push(node);
466 }
467 return items;
468 }, []),
469 ),
470 );
471
472 const keyManagerOptions: TreeKeyManagerOptions<CdkTreeNode<T, K>> = {
473 trackBy: node => this._getExpansionKey(node.data),
474 skipPredicate: node => !!node.isDisabled,
475 typeAheadDebounceInterval: true,
476 horizontalOrientation: this._dir.value,
477 };
478
479 this._keyManager = this._keyManagerFactory(items, keyManagerOptions);
480 }
481
482 private _initializeDataDiffer() {
483 // Provide a default trackBy based on `_getExpansionKey` if one isn't provided.

Callers 1

ngAfterContentInitMethod · 0.95

Calls 3

_getExpansionKeyMethod · 0.95
getMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected