MCPcopy
hub / github.com/angular/angular / _matchPartial

Method _matchPartial

packages/compiler/src/directive_matching.ts:421–439  ·  view source on GitHub ↗

@internal

(
    map: Map<string, SelectorMatcher<T>>,
    name: string,
    cssSelector: CssSelector,
    matchedCallback: ((c: CssSelector, a: any) => void) | null,
  )

Source from the content-addressed store, hash-verified

419
420 /** @internal */
421 _matchPartial(
422 map: Map<string, SelectorMatcher<T>>,
423 name: string,
424 cssSelector: CssSelector,
425 matchedCallback: ((c: CssSelector, a: any) => void) | null,
426 ): boolean {
427 if (!map || typeof name !== 'string') {
428 return false;
429 }
430
431 const nestedSelector = map.get(name);
432 if (!nestedSelector) {
433 return false;
434 }
435 // TODO(perf): get rid of recursion and measure again
436 // TODO(perf): don't pass the whole selector into the recursion,
437 // but only the not processed parts
438 return nestedSelector.match(cssSelector, matchedCallback);
439 }
440}
441
442export class SelectorListContext {

Callers 1

matchMethod · 0.95

Calls 2

getMethod · 0.65
matchMethod · 0.45

Tested by

no test coverage detected