MCPcopy
hub / github.com/angular/angular / _matchTerminal

Method _matchTerminal

packages/compiler/src/directive_matching.ts:393–418  ·  view source on GitHub ↗

@internal

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

Source from the content-addressed store, hash-verified

391
392 /** @internal */
393 _matchTerminal(
394 map: Map<string, SelectorContext<T>[]>,
395 name: string,
396 cssSelector: CssSelector,
397 matchedCallback: ((c: CssSelector, a: any) => void) | null,
398 ): boolean {
399 if (!map || typeof name !== 'string') {
400 return false;
401 }
402
403 let selectables: SelectorContext<T>[] = map.get(name) || [];
404 const starSelectables: SelectorContext<T>[] = map.get('*')!;
405 if (starSelectables) {
406 selectables = selectables.concat(starSelectables);
407 }
408 if (selectables.length === 0) {
409 return false;
410 }
411 let selectable: SelectorContext<T>;
412 let result = false;
413 for (let i = 0; i < selectables.length; i++) {
414 selectable = selectables[i];
415 result = selectable.finalize(cssSelector, matchedCallback) || result;
416 }
417 return result;
418 }
419
420 /** @internal */
421 _matchPartial(

Callers 1

matchMethod · 0.95

Calls 2

getMethod · 0.65
finalizeMethod · 0.45

Tested by

no test coverage detected