MCPcopy Index your code
hub / github.com/angular/angular / getIdxOfMatchingSelector

Function getIdxOfMatchingSelector

packages/core/src/render3/queries/query.ts:328–338  ·  view source on GitHub ↗

* Iterates over local names for a given node and returns directive index * (or -1 if a local name points to an element). * * @param tNode static data of a node to check * @param selector selector to match * @returns directive index, -1 or null if a selector didn't match any of the local names

(tNode: TNode, selector: string)

Source from the content-addressed store, hash-verified

326 * @returns directive index, -1 or null if a selector didn't match any of the local names
327 */
328function getIdxOfMatchingSelector(tNode: TNode, selector: string): number | null {
329 const localNames = tNode.localNames;
330 if (localNames !== null) {
331 for (let i = 0; i < localNames.length; i += 2) {
332 if (localNames[i] === selector) {
333 return localNames[i + 1] as number;
334 }
335 }
336 }
337 return null;
338}
339
340function createResultByTNodeType(tNode: TNode, currentView: LView): any {
341 if (tNode.type & (TNodeType.AnyRNode | TNodeType.ElementContainer)) {

Callers 1

matchTNodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…