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

Method _getPositionInSet

src/cdk/tree/tree.ts:858–862  ·  view source on GitHub ↗

* For the given node, determine the index (starting from 1) of the node in its parent's child set. * * This is intended to be used for `aria-posinset`.

(dataNode: T)

Source from the content-addressed store, hash-verified

856 * This is intended to be used for `aria-posinset`.
857 */
858 _getPositionInSet(dataNode: T) {
859 const set = this._getAriaSet(dataNode);
860 const key = this._getExpansionKey(dataNode);
861 return set.findIndex(node => this._getExpansionKey(node) === key) + 1;
862 }
863
864 /** Given a CdkTreeNode, gets the node that renders that node's parent's data. */
865 _getNodeParent(node: CdkTreeNode<T, K>) {

Callers 1

_getPositionInSetMethod · 0.45

Calls 2

_getAriaSetMethod · 0.95
_getExpansionKeyMethod · 0.95

Tested by

no test coverage detected